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.

Null ref error while publishing with Runtime identifier set as win7-x64

See original GitHub issue

Call stack:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.NETCore.Build.Tasks.LockFileExtensions.IsPortable(LockFileTarget lockFileTarget)
   at Microsoft.NETCore.Build.Tasks.ResolvePublishAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
        Done executing task "ResolvePublishAssemblies" -- FAILED.

Log attached: Publish_RID_NullRef.txt

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
eerhardtcommented, Oct 11, 2016

Can we call the restore target directly and pass the RID?

Calling restore from another target inside of MSBuild doesn’t work. Calling restore will can bring down different .props/.targets files. These .props/.targets files won’t be loaded by MSBuild because it has already imported all the .props/.targets files.

One thing you could do is define $(RuntimeIdentifier) or $(RuntimeIdentifiers) in your project. Then when restore is run, it will automatically restore for those RIDs, since those properties are set.

@rainersigwald @AndyGerlicher @emgarten @rrelyea @nguerrera

0reactions
vijayrkncommented, Oct 11, 2016

Can we call the restore target directly and pass the RID?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking change: Automatic RuntimeIdentifier - .NET
Learn about a breaking change in the .NET 7 SDK where a RuntimeIdentifier is automatically added to projects that use certain publish ......
Read more >
Architecture in a .net core app - Elements
Hi, If I create a .net core library and set the architecture to something other than anycpu what does it do ? Also...
Read more >
c# - Troubleshooting BadImageFormatException
I have Win7 64 bit, 32-bit Oracle Client, and have my MVC 5 project set to run on x86 platform because of the...
Read more >
Cannot debug net6.0-macos Apps - Developer Community
When I hit debug, the following error is shown in the Terminal: Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >
Configuration
At runtime, the CLI verifies that only one of the specified values was used, or fails with an error message. minValues. integer? (format:...
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