How to edit .csproj file

The CSPROJ file, saved in XML format, stores all the references for your project including your compilation options. There is also an SLN file, which stores information about projects that make up your solution. If you are using Visual Studio and you have the need to view or edit your CSPROJ file, while in Visual … Read more

Visual Studio project type guids

Here’s a list of project type GUIDs: 8BB2217D-0F2D-49D1-97BC-3654ED321F3B ASP.NET 5 603C0E0B-DB56-11DC-BE95-000D561079B0 ASP.NET MVC 1 F85E285D-A4E0-4152-9332-AB1D724D3325 ASP.NET MVC 2 E53F8FEA-EAE0-44A6-8774-FFD645390401 ASP.NET MVC 3 E3E379DF-F4C6-4180-9B81-6769533ABE47 ASP.NET MVC 4 349C5851-65DF-11DA-9384-00065B846F21 ASP.NET MVC 5 / Web Application FAE04EC0-301F-11D3-BF4B-00C04F79EFBC C# 9A19103F-16F7-4668-BE54-9A1E7A4F7556 C# (forces use of SDK project system) 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942 C++ 13B669BE-BB05-4DDF-9536-439F39A36129 CPS barebones project A9ACE9BB-CECE-4E62-9AA4-C7E7C5BD2124 Database 4F174C21-8C12-11D0-8340-0000F80270F8 Database C8D11400-126E-41CD-887F-60BD40844F9E Database … Read more

How do you multi-target a .NET Core class library with csproj?

You need to manually edit the project file and add s to the default TargetFramework and basically change it to TargetFrameworks. Then you mention the Moniker with a ; separator. Also you can put the Nuget package references in a conditional ItemGroup manually or using VS Nuget Package Manager. Here is what your .csproj should … Read more

Is there a way to automatically include content files into asp.net project file?

Old thread, I know, but I found a way to do this that I keep forgetting, and on my search to find it one last time, I stumbled upon this question. The best way I’ve found to this is is to use the BeforeBuild target in the .csproj file. <Target Name=”BeforeBuild”> <ItemGroup> <Content Include=”**\*.less” /> … Read more

How do I get .NET Core projects to copy NuGet references to the build output?

You can add this to a <PropertyGroup> inside your csproj file to enforce copying NuGet assemblies to the build output: <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> However, note that the build output (bin/Release/netcoreapp*/*) is not supposed to be portable and distributable, the output of dotnet publish is. But in your case, copying the assemblies to the build output is probably … Read more