dotnet publish doesn´t publish correct appsettings.{env.EnvironmentName}.json

Update: For current (new) .csproj format the CopyToPublishDirectory attribute should be used. It determines whether to copy the file to the publish directory and can have one of the following value: Always, PreserveNewest Never So add next section into your .csproj: <ItemGroup> <None Include=”appsettings.Production.json” CopyToPublishDirectory=”Always” /> </ItemGroup> Look into @nover answer and SO Exclude or … Read more

The library hostpolicy.dll was not found

Update for dotnet core 2.0 and beyond: the file appname.runtimeconfig.json (for both debug and release configuration) is needed in the same path as appname.dll. It contains: { “runtimeOptions”: { “tfm”: “netcoreapp2.0”, “framework”: { “name”: “Microsoft.NETCore.App”, “version”: “2.0.0” } } } then dotnet.exe exec “path/to/appname.dll” [appargs] works.

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