I am migrating a library from .Net 4.5
to .net core
. I already have the .xproj
in place, but when I run dotnet build
I get the error:
Microsoft.DotNet.Common.Targets(262,5): error : Obje ct reference not set to an instance of an object.
this is my project.json
file:
{
"version": "1.0.0",
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Collections.Concurrent": {
"type": "build"
}
}
},
"netstandard1.6": {
"imports": "dnxcore50",
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}
is there something I'm missing?
I had the same problem in VS2015 (Community) starting a ASP.NET MVC Core project from scratch and updating to Core 1.1.1. For some unknown reason, Nuget does not update 100% of the references; some of them remain a "step behind".
Below you can find my project.json file
Microsoft.AspNetCore.Razor.Tools
did not update correctly.Microsoft.VisualStudio.Web.CodeGeneration.Tools
andMicrosoft.VisualStudio.Web.CodeGenerators.Mvc
had to be updated manually as well.Running
dotnet restore
from command line worked but not from Visual Studio 2015 Update 3. I suspect this has something to do with having private nuget feeds.If you get this error on a TFS build on a remote server you can still run
dotnet restore
manually.eg. I switched to
C:\BUILD-AGENT\_work\1\s\RR.CRM
and randotnet restore
Still not quite sure when VS does this or doesn't do it, but for now it was a quick fix that worked.