Can files be nested in VS2017 Solution Explorer for .NET Core (non-ASP.NET Core) projects?

I have it working in one of my Microsoft.NET.Sdk-style projects using something similar to the following: <ItemGroup> <Compile Update=”LocalDateTest.*.cs”> <DependentUpon>LocalDateTest.cs</DependentUpon> </Compile> </ItemGroup> The trick here is to use Update instead of Include. This is because the implicit items are coming from a props file that is imported before the main project. An additional Include won’t … 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 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

Relationship between the dotnet cli and the new vs2017 msbuild

Questions To build a new csproj netstandard library from the command line, should I be calling the dotnet cli (for example dotnet restore dotnet build) or use msbuild (for example msbuild ExampleNetstandard.sln). Both do fine as currently dotnet is built on top of msbuild. So it’s a matter of taste. You could also call msbuild … Read more

Detected package downgrade warning (dotnet core, vs 2017)

This situation occurred to me after opening an existing solution but instead of Warnings, they were Errors. I opened the YourAwesomeApp.csproj file and went through the “Detected package downgrade” errors one-by-one and manually changed the version of that line item from the existing version to the specified version that was shown in the error itself. … 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

In a .csproj file, what is for?

The MSDN article on the build action property explains the differences. None – The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file. Content – The file is not compiled, but is included … Read more