This error was fixed in the latest snet kernel in dotnet, in my case it is the latest version 1.0.0-rc4-004578.
Unfortunately, in the new releases, they decided that the .csproj file did not even need the default compilation templates and resources that would be included by default in msbuild tasks.
Thus, if they are included in your .csproj file, you will not be able to compile it with rc4.
So, here are the steps / changes that did the job for me:
- download and install dotnet sdk rc4 or higher from https://github.com/dotnet/cli]
- add the global.json solution / project folder targeting the new dotnet kernel, in my case:
{ "sdk": { "version": "1.0.0-rc4-004578" } }
open the .csproj file and edit it (now you can right in VS 2017); add a debug configuration condition to the elements of the default elements
<ItemGroup Condition=" '$(Configuration)' == 'Debug' "> <Compile Include="**\*.cs" /> <EmbeddedResource Include="**\*.resx" /> </ItemGroup>
make sure you are using the right (new) dotnet sdk:
dotnet --versoin
publish the release configuration file
dotnet publish PATH\MyPorject.csproj -c Release -o OUT_DIR
Please note that we saved the default compilation template section in the .csproj file, but with the debug configuration condition that you need if you want your projects to compile and run in VS 2017 RC, which uses dotnet sdk preview4.
Just keep in mind that your active configuration there needs to be debugged.
You can find more information about the issue discussed here in the dotnet command stream at [ https://github.com/dotnet/cli/issues/4759#issuecomment-274904448]
source share