Prerequisites:
- Install Visual Studio Code.
- Install the .NET Core SDK.
- Install the C# extension(OmniSharp) from the Visual Studio Code Marketplace.(Code highlight and Intellengent)
Start Sample Application
- Open Visual Studio Code
- Select the folder.
- Go to View -> Click Integrated Terminal Window(CTRL+`)
- Type "dotnet new"
- It will show the Templates
- Console Application - Type dotnet new console
- Class library - Type dotnet new classlib
- Unit Test Project - Type dotnet new mstest
- xUnit Test Project - Type dotnet new xunit
- ASP.NET Core Empty - Type dotnet new web
- ASP.NET Core Web App - Type dotnet new mvc
- ASP.NET Core Web API - Type dotnet new webapi
- Solution File -Type dotnet new sln
- Type dotnet restore (Running restore pulls down the required packages declared in the project.json file.)
- Type dotnet build
- Type dotnet run
- Type dotnet publish
- Type dotnet clean
Local Nuget Package path:
- C:\Users\username\.nuget\packages
Publish and Host IIS :
- Type dotnet publish
- Host Path : ...\bin\Debug\netcoreapp1.1\publish
Error: Show Error Code 0x8007000d -> Ckeck installed "windows server hosting bundle" and "Url Rewrite "
Add Nuget Package(Entity Frame Work):
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
OR
- dotnet add package Microsoft.EntityFrameworkCore.SqlServer
- dotnet add package Microsoft.EntityFrameworkCore
- dotnet add package Microsoft.EntityFrameworkCore.Relational
- dotnet add package Microsoft.EntityFrameworkCore.DbContext
- dotnet add package Microsoft.AspNetCore.Mvc.Core
Remove Nuget Package:
- dotnet remove package <package name>
- <ProjectReference Include="..\Test1\Test1.csproj"/>
Connect SQL Server:
Link - https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-develop-use-vscode
Popular Extension:
- OmniSharp
- Csharp-ASPNETCore(auto generater code -> In controller-> type ->MVC-core-get)
- wilderminds-aspnetcore-snippets(type cs file ->EF-dbcontext auto generated entitiy framework code)
- mssql(conntect sql database)
- vscode-icons(file icon)
- html-snippets
- aspnet-helper
- Auto Close Tag
- Auto Rename Tag
- Go(gocode)
- Code runner
- Notepad++ keymap
- Spelling Checker