question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GenerateRuntimeConfigurationFiles task failed unexpectedly on a project targeting netcoreapp1.0

See original GitHub issue

Setup:

CLI Version : 2.0.0-preview1-005972 VS Version: d15rel 26507.0

Repro steps:

  1. Create a new Asp.NET Core Web application (1.0) in VS
  2. Add a global.json with { "sdk" : { "version": "1.0.4" } }
  3. Right click project -> Publish -> Folder -> Publish.

It fails with the error

C:\Program Files\dotnet\sdk\2.0.0-preview1-005972\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets(134,5): Error MSB4018: The "GenerateRuntimeConfigurationFiles" task failed unexpectedly.
System.InvalidCastException: [A]NuGet.ProjectModel.LockFile cannot be cast to [B]NuGet.ProjectModel.LockFile. Type A originates from 'NuGet.ProjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadFrom' at location 'C:\Program Files\dotnet\sdk\1.0.4\Sdks\Microsoft.NET.Sdk\tools\net46\NuGet.ProjectModel.dll'. Type B originates from 'NuGet.ProjectModel, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadFrom' at location 'C:\Program Files\dotnet\sdk\2.0.0-preview1-005972\Sdks\Microsoft.NET.Sdk\tools\net46\NuGet.ProjectModel.dll'.
   at Microsoft.NET.Build.Tasks.LockFileCache.GetLockFile(String path)
   at Microsoft.NET.Build.Tasks.GenerateRuntimeConfigurationFiles.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

cc @vijayrkn @mlorbetske @balachir

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vijayrkncommented, May 10, 2017

@nguerrera for the publish issue, the code is in tfs and we will fix it.

0reactions
nguerreracommented, May 9, 2017

Moved to CLI because the resolver is implemented there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GenerateRuntimeConfigurationFi...
I'm getting inconsistent errors when building my docker image. This fails approximately 1 out of 3 times, if i keep running docker build....
Read more >
MSB4131 when building any ASP.NET Core 1.1 App
Verify the parameter exists on the task, and it is a gettable public instance property. This error appears whenever building ANY ASP.NET Core ......
Read more >
Error MSB4018 - The Object of Your Affection
I have reached “Objects and Classes - Project - The Object of Your ... The "GenerateRuntimeConfigurationFiles" task failed unexpectedly.
Read more >
NET SDK error list - .NET CLI
It cannot be referenced by a project that targets '{1}'. ... NET SDK includes '{0}' items from your project directory by default.
Read more >
MSBuild reference for .NET SDK projects
The project file in the following example targets netstandard1.3 but uses the 1.6.0 version of NETStandard.Library .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found