0
votes

The .NET Core project compiled fine new. Once you update your NUGET packages it fails with messages listed below.

This was happening before and after the install of the new tools. Updated today: DotNetCore.1.0.1-VS2015Tools.Preview2.0.3

Errors: Severity Code Description Project File Line Suppression State

Error 3. You may be trying to publish a library, which is not supported. Use dotnet pack to distribute libraries.

Error 2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.

Error 1. The project has not been restored or restore failed - run dotnet restore

Error Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. I also removed the global.json version specification as I was told it just uses the latest which saves me some time, should I not be doing that?

I can not understand how this was not tested. I created a brand new clean web application using .NET Core template in VS2015. I updated NUGET, even tried including pre-releases. Now the whole thing fails.

Thoughts and questions:

  1. Can anyone tell us how to create a simple .NET CORE WEB project config without all the bloat that will be hosted simply on a Windows Server? This is what most people will be doing. It would be nice to have a simple project.config and not as many dependencies when publishing to IIS. Every update you have to dig in and tweak your project config, this needs to stop right?

  2. Why is the 'runtimes' section in the project config not included in the default template?

  3. Seems strange to me that your project blows up every update.

3
What is your .net core sdk version? Also, update your question with your project.json. I've created a simple tutorial that may help you. It's for 1.0.0, but the process is the same for this new version.Fabricio Koch
Did you install the sdk/untime too? What inside C:\Program Files\dotnet\shared\Microsoft.NETCore.App and C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App respectively folder?Tseng
@Tseng Nothing in x86 folder. Folder 1.0.1 in the C:\Program Files\dotnet\shared\Microsoft.NETCore.App.Chris Go
@Fabricio Koch Thank you I will go through your tutorial soon as VS 2017 is released as final.Chris Go

3 Answers

1
votes

I get the same error when upgrade Microsoft.NETCore.App from version 1.0.1 to version 1.1.0. Please add "type":"platform" option in Dependencies node in project.json.

"dependencies": {
"Microsoft.NETCore.App": {
  "version": "1.1.0",
  "type": "platform"
 }
},

And we often use Web.config file to configure handler information when deploy to IIS. The project.json file used to manage the project dependencies. So if there has any dependencies changed in your project, you just need to upgrade your project.json file. The Web.config file need not to be changed.

About why the "runtimes" section not include in default project template issue, this is because different users need different runtimes. Every users could add this sections into project.json file based on the project's requirement.

0
votes

You can simply add the runtimes to your project.json file just as the error message indicated. For example:

"runtimes": {
    "win7-x64": { }
  }

Usually, you don't need to specify the runtimes option. But it is needed for Self-contained deployments (SCD). Refer to runTimes and Self-contained deployments (SCD) for more information.

0
votes

This is a non-issue as they changed how all this works in newer versions.