This seems to be a re-occurrence of #5995, though it is user specific. One user on the machine will have an issue, another can login, clear the obj folder, and build without a problem. Bit stumped on how to get this working across all users on this shared build machine. Tried clearing everyone's temp folders, caches, and giving it a reboot to flush out any lingering issues.
This problem appearing did seem to coincide with the release of .NET 5.0, but not sure right now if that really caused it.
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): NuGet.exe
NuGet version (x.x.x.xxx): 5.8.0.6930
dotnet.exe --version (if appropriate): 5.0.100
VS version (if appropriate): 16.8.0
OS version (i.e. win10 v1607 (14393.321)): Win7 SP1 (v6.1 build 7601)
Worked before? If so, with which NuGet version: unknown
Load up attached project in Visual Studio
Attempt to build.
Comparing the two asset files, the good build has all the "compile" key and a second value under the "build" key that are missing from the bad build asset file. Aside from that, the two json files appear to be the same.
Good asset file
{
"version": 3,
"targets": {
".NETCoreApp,Version=v2.1": {
"Microsoft.NETCore.App/2.1.23": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.DotNetHostPolicy": "2.1.23",
"Microsoft.NETCore.Platforms": "2.1.12",
"Microsoft.NETCore.Targets": "2.0.0",
"NETStandard.Library": "2.0.3"
},
"compile": {
"ref/netcoreapp2.1/Microsoft.CSharp.dll": {},
"ref/netcoreapp2.1/Microsoft.VisualBasic.dll": {},
"ref/netcoreapp2.1/Microsoft.Win32.Primitives.dll": {},
"ref/netcoreapp2.1/System.AppContext.dll": {},
"ref/netcoreapp2.1/System.Buffers.dll": {},
"ref/netcoreapp2.1/System.Collections.Concurrent.dll": {},
"ref/netcoreapp2.1/System.Collections.Immutable.dll": {},
"ref/netcoreapp2.1/System.Collections.NonGeneric.dll": {},
"ref/netcoreapp2.1/System.Collections.Specialized.dll": {},
"ref/netcoreapp2.1/System.Collections.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.Annotations.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.DataAnnotations.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.EventBasedAsync.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.Primitives.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.TypeConverter.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.dll": {},
"ref/netcoreapp2.1/System.Configuration.dll": {},
"ref/netcoreapp2.1/System.Console.dll": {},
"ref/netcoreapp2.1/System.Core.dll": {},
"ref/netcoreapp2.1/System.Data.Common.dll": {},
"ref/netcoreapp2.1/System.Data.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Contracts.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Debug.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.DiagnosticSource.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.FileVersionInfo.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Process.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.StackTrace.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.TextWriterTraceListener.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Tools.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.TraceSource.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Tracing.dll": {},
"ref/netcoreapp2.1/System.Drawing.Primitives.dll": {},
"ref/netcoreapp2.1/System.Drawing.dll": {},
"ref/netcoreapp2.1/System.Dynamic.Runtime.dll": {},
"ref/netcoreapp2.1/System.Globalization.Calendars.dll": {},
"ref/netcoreapp2.1/System.Globalization.Extensions.dll": {},
"ref/netcoreapp2.1/System.Globalization.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.Brotli.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.FileSystem.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.ZipFile.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.DriveInfo.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.Primitives.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.Watcher.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.dll": {},
"ref/netcoreapp2.1/System.IO.IsolatedStorage.dll": {},
"ref/netcoreapp2.1/System.IO.MemoryMappedFiles.dll": {},
"ref/netcoreapp2.1/System.IO.Pipes.dll": {},
"ref/netcoreapp2.1/System.IO.UnmanagedMemoryStream.dll": {},
"ref/netcoreapp2.1/System.IO.dll": {},
"ref/netcoreapp2.1/System.Linq.Expressions.dll": {},
"ref/netcoreapp2.1/System.Linq.Parallel.dll": {},
"ref/netcoreapp2.1/System.Linq.Queryable.dll": {},
"ref/netcoreapp2.1/System.Linq.dll": {},
"ref/netcoreapp2.1/System.Memory.dll": {},
"ref/netcoreapp2.1/System.Net.Http.dll": {},
"ref/netcoreapp2.1/System.Net.HttpListener.dll": {},
"ref/netcoreapp2.1/System.Net.Mail.dll": {},
"ref/netcoreapp2.1/System.Net.NameResolution.dll": {},
"ref/netcoreapp2.1/System.Net.NetworkInformation.dll": {},
"ref/netcoreapp2.1/System.Net.Ping.dll": {},
"ref/netcoreapp2.1/System.Net.Primitives.dll": {},
"ref/netcoreapp2.1/System.Net.Requests.dll": {},
"ref/netcoreapp2.1/System.Net.Security.dll": {},
"ref/netcoreapp2.1/System.Net.ServicePoint.dll": {},
"ref/netcoreapp2.1/System.Net.Sockets.dll": {},
"ref/netcoreapp2.1/System.Net.WebClient.dll": {},
"ref/netcoreapp2.1/System.Net.WebHeaderCollection.dll": {},
"ref/netcoreapp2.1/System.Net.WebProxy.dll": {},
"ref/netcoreapp2.1/System.Net.WebSockets.Client.dll": {},
"ref/netcoreapp2.1/System.Net.WebSockets.dll": {},
"ref/netcoreapp2.1/System.Net.dll": {},
"ref/netcoreapp2.1/System.Numerics.Vectors.dll": {},
"ref/netcoreapp2.1/System.Numerics.dll": {},
"ref/netcoreapp2.1/System.ObjectModel.dll": {},
"ref/netcoreapp2.1/System.Reflection.DispatchProxy.dll": {},
"ref/netcoreapp2.1/System.Reflection.Emit.ILGeneration.dll": {},
"ref/netcoreapp2.1/System.Reflection.Emit.Lightweight.dll": {},
"ref/netcoreapp2.1/System.Reflection.Emit.dll": {},
"ref/netcoreapp2.1/System.Reflection.Extensions.dll": {},
"ref/netcoreapp2.1/System.Reflection.Metadata.dll": {},
"ref/netcoreapp2.1/System.Reflection.Primitives.dll": {},
"ref/netcoreapp2.1/System.Reflection.TypeExtensions.dll": {},
"ref/netcoreapp2.1/System.Reflection.dll": {},
"ref/netcoreapp2.1/System.Resources.Reader.dll": {},
"ref/netcoreapp2.1/System.Resources.ResourceManager.dll": {},
"ref/netcoreapp2.1/System.Resources.Writer.dll": {},
"ref/netcoreapp2.1/System.Runtime.CompilerServices.VisualC.dll": {},
"ref/netcoreapp2.1/System.Runtime.Extensions.dll": {},
"ref/netcoreapp2.1/System.Runtime.Handles.dll": {},
"ref/netcoreapp2.1/System.Runtime.InteropServices.RuntimeInformation.dll": {},
"ref/netcoreapp2.1/System.Runtime.InteropServices.WindowsRuntime.dll": {},
"ref/netcoreapp2.1/System.Runtime.InteropServices.dll": {},
"ref/netcoreapp2.1/System.Runtime.Loader.dll": {},
"ref/netcoreapp2.1/System.Runtime.Numerics.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Formatters.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Json.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Primitives.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Xml.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.dll": {},
"ref/netcoreapp2.1/System.Runtime.dll": {},
"ref/netcoreapp2.1/System.Security.Claims.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Algorithms.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Csp.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Encoding.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Primitives.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.X509Certificates.dll": {},
"ref/netcoreapp2.1/System.Security.Principal.dll": {},
"ref/netcoreapp2.1/System.Security.SecureString.dll": {},
"ref/netcoreapp2.1/System.Security.dll": {},
"ref/netcoreapp2.1/System.ServiceModel.Web.dll": {},
"ref/netcoreapp2.1/System.ServiceProcess.dll": {},
"ref/netcoreapp2.1/System.Text.Encoding.Extensions.dll": {},
"ref/netcoreapp2.1/System.Text.Encoding.dll": {},
"ref/netcoreapp2.1/System.Text.RegularExpressions.dll": {},
"ref/netcoreapp2.1/System.Threading.Overlapped.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.Dataflow.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.Extensions.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.Parallel.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.dll": {},
"ref/netcoreapp2.1/System.Threading.Thread.dll": {},
"ref/netcoreapp2.1/System.Threading.ThreadPool.dll": {},
"ref/netcoreapp2.1/System.Threading.Timer.dll": {},
"ref/netcoreapp2.1/System.Threading.dll": {},
"ref/netcoreapp2.1/System.Transactions.Local.dll": {},
"ref/netcoreapp2.1/System.Transactions.dll": {},
"ref/netcoreapp2.1/System.ValueTuple.dll": {},
"ref/netcoreapp2.1/System.Web.HttpUtility.dll": {},
"ref/netcoreapp2.1/System.Web.dll": {},
"ref/netcoreapp2.1/System.Windows.dll": {},
"ref/netcoreapp2.1/System.Xml.Linq.dll": {},
"ref/netcoreapp2.1/System.Xml.ReaderWriter.dll": {},
"ref/netcoreapp2.1/System.Xml.Serialization.dll": {},
"ref/netcoreapp2.1/System.Xml.XDocument.dll": {},
"ref/netcoreapp2.1/System.Xml.XPath.XDocument.dll": {},
"ref/netcoreapp2.1/System.Xml.XPath.dll": {},
"ref/netcoreapp2.1/System.Xml.XmlDocument.dll": {},
"ref/netcoreapp2.1/System.Xml.XmlSerializer.dll": {},
"ref/netcoreapp2.1/System.Xml.dll": {},
"ref/netcoreapp2.1/System.dll": {},
"ref/netcoreapp2.1/WindowsBase.dll": {},
"ref/netcoreapp2.1/mscorlib.dll": {},
"ref/netcoreapp2.1/netstandard.dll": {}
},
"build": {
"build/netcoreapp2.1/Microsoft.NETCore.App.props": {},
"build/netcoreapp2.1/Microsoft.NETCore.App.targets": {}
}
},
Bad Asset file
{
"version": 3,
"targets": {
".NETCoreApp,Version=v2.1": {
"Microsoft.NETCore.App/2.1.23": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.DotNetHostPolicy": "2.1.23",
"Microsoft.NETCore.Platforms": "2.1.12",
"Microsoft.NETCore.Targets": "2.0.0",
"NETStandard.Library": "2.0.3"
},
"build": {
"build/netcoreapp2.1/Microsoft.NETCore.App.props": {}
}
},
Hey @moonboy13
I was unable to repro this locally.
The project restored correctly and I had no trouble building.
Can you still repro this?
Any warnings/logs that VS is reporting?
What happens if you try to run msbuild.exe /t:restore from the commandline?
Hey @nkolev92, still able to reproduce this consistently for some users.
Grabbed the output of the command you suggested, one from a user that can build and one from a user that cannot. Added in the -verbosity:d flag to the output as well so there is a lot of info.
Running a diff between the two files, I noticed something interesting on line 1262 for the OutputSources. On the successful build
the sources include an https://dotnet.myget.org/F/roslyn/api/v3/index.json and on the failed builds that source is missing.
Is that value set based off of a cached user setting? If we just need to clear a cache somewhere for certain users then that can work around the issue for us.
We have noticed the pattern that users who most heavily built off the virtual machine having the issue prior to the release of 16.8.0 are running into the failed build error, while users who logged on after the 16.8.0 update was applied and then built for the first time are not running into any problems.
VS has no specific warnings, other than missing all the various namespace and class definitions for the missing assets.
Based on the logs, the extra source is likely specified in one of the configs.
I'd recommend you add a NuGet.Config in the root of your repo with all required sources.
VS has no specific warnings, other than missing all the various namespace and class definitions for the missing assets.
Can you please try running restore in VS and provide us the logs + screenshot from the errors in the error list.
We matched the NuGet configs between the successful build and failed build, ensuring that the dotnet.myget source was available, but ran into the same build problem.
Here is a sample of the errors from the build process:
C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\obj\Debug\netcoreapp2.1\.NETCoreApp,Version=v2.1.AssemblyAttributes.cs(4,35): error CS0234: The type or namespace name 'Versioning' does not exist in the namespace 'System.Runtime' (are you missing an assembly reference?) [C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\Rendering.csproj]
C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\obj\Debug\netcoreapp2.1\Rendering.AssemblyInfo.cs(14,19): error CS0234: The type or namespace name 'Reflection' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\Rendering.csproj]
C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\obj\Debug\netcoreapp2.1\Rendering.AssemblyInfo.cs(15,19): error CS0234: The type or namespace name 'Reflection' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\Rendering.csproj]
C:\Users\sgordon\Desktop\MultiTargetFail\Rendering\obj\Debug\netcoreapp2.1\Rendering.AssemblyInfo.cs(16,19): error CS0234: The type or namespace name 'Reflection' does not exist in the namespace 'System' (are you missing an assembly reference?)
Full build log for reference: VSBuildOutput.txt
hey @moonboy13
would you mind pasting the commandline log instead?
Restore in VS doesn't run through msbuild so it's more challenging to debug it.
MSBuildLog_NormalVerbosity.txt
Nuget Restore.txt
@nkolev92 Adding the output of a rebuild from the command line, dropped the verbosity to Normal to reduce the amount of noise and attached the output of the nuget restore command.
hey @moonboy13 sorry for the delay.
the restore verbosity is unfortunately not high enough to infer anything useful out of it.
The higher verbosity allows us to see the list of sources and a bunch of other properties set by the SDK.
@nkolev92, the output on https://github.com/NuGet/Home/issues/10313#issuecomment-737284611 is the full verbose log from running the restore command. Is there something missing from there to help diagnose the issue?
Adding the source https://dotnet.myget.org/F/roslyn/api/v3/index.json using the Nuget.config did not help the build, still seeing the missing assets in the obj\project.assets.json file that lead to the failed build.
Hey @moonboy13
Looked at it again, unfortunately I'm unable to find anything that could be the root cause.
There's barely any differences between the 2 logs and the only potentially meaningful thing impacting NuGet was the source difference.
Can you try looking at Microsoft.NETCore.App in the global packages folder and see if they are any different.
Hey @nkolev92 , I'm the dev having this issue. I'll be able to compare those folders later today and will let you know, thanks!
Hey @nkolev92,
These are the versions I have listed on the machine that I can't build on:
2.1.12
2.1.13
2.1.15
2.1.16
2.1.17
2.1.18
2.1.20
2.1.21
2.1.22
2.1.23
And these are the versions listed on my local machine where I can build:
2.1.0
2.1.12
2.1.13
2.1.14
2.1.15
2.1.17
2.1.18
2.1.19
2.1.20
2.1.21
2.1.22
2.1.23
Please let me know if you need anything further, thank you.
Hey @sgordon5691 Can you look at the content of the individual directories?
Does clearing the global packages folder fix your issue?
Hey @nkolev92, I can try clearing that folder out completely in the morning and seeing if that does the trick. I'll keep you posted, thanks!
Hey @nkolev92,
Clearing out that global packages folder may have done the trick! I was able to clean and rebuild the solution. I will have a more definite answer next week, but hopefully this ends up fixing it. Thanks and enjoy your holidays!
Hey @nkolev92,
Just wanted to confirm all has been working well since clearing out the global packages folder. You can close this guy up. Thanks again for all your help!
@nkolev92 @sgordon5691 Thanks guys for the help and diligence in getting a resolution to this. Really appreciate the work especially over the holiday week.