Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core 2 does not work.... #920

Closed
NikasZalias opened this issue Aug 31, 2017 · 18 comments
Closed

.NET Core 2 does not work.... #920

NikasZalias opened this issue Aug 31, 2017 · 18 comments

Comments

@NikasZalias
Copy link

Can't find the issue... I've installed dotnet core 2 SDK and Runtime from here https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.0-download.md

Restarted my PC (Windows 10 Pro x64 (Latest Version))

Ran my Visual Studio 2017 Enterprise 15.3.3.

Started new project (Console App (.NET Core)) and then this happened...

error

Could someone please explain me what I did wrong??

@Petermarcu
Copy link
Member

That all seems correct to me. Can you try opening a command window and typing dotnet run in the project folder? That would help determine if its something wrong with the SDK install or something wrong with Visual Studio.

@itanex
Copy link

itanex commented Sep 1, 2017

I have not been able to reproduce this issue. I removed all core frameworks and put just 2 into my VM and nothing seems to be wrong.

I have seen VS behave like this before though with various other things and it usually has to do with a number of language services crashing or locking up. Have you tried a hard reset of your computer?

Edit: Also to note I have installed the latest asp.net core sdk even though the version still reports 2.0.0. Perhaps removing the sdk and reinstalling or trying the repair function of the installer.

@NikasZalias
Copy link
Author

NikasZalias commented Sep 1, 2017

@Petermarcu I've just tried with CMD and here's what I got...

image

and when I type dotnet --version I can see it's 2.0.0 so basically it's all good, but maybe it is possible that many .NET Core SDKs are somehow disturbing each other??

@NikasZalias
Copy link
Author

@itanex no I have not tried hard reset my computer and it would be nice to stay that way...

@Petermarcu
Copy link
Member

Can you create a diag log dotnet build /flp:v=diag? It will put an msbuild.log file next to your project. Can you zip that up with your project and share it? Something unexpected is going on and that should give us the info we need to understand it.

@NikasZalias
Copy link
Author

So i made diag log, zipped my entire project and added it to Google Drive. Here is the link:

https://drive.google.com/drive/folders/0Byw8_OcVom5XWFl4SXNJN1hOYXc?usp=sharing

Hope you'll find the problem, because I'm desperete...

@Petermarcu
Copy link
Member

@ericstj to also take a look to see if he can see what's wrong.

@Petermarcu
Copy link
Member

Adding @nguerrera and @dsplaisted as well.

@ericstj
Copy link
Member

ericstj commented Sep 5, 2017

Something is wrong with the assets file. Perhaps your NuGetFallBack folder (C:\Program Files\dotnet\sdk\NuGetFallbackFolder) is corrupt? If you are able to reproduce this perhaps @emgarten could find out why NuGet is returning partial results.

In the project.assets.json, I see the following:

      "Microsoft.NETCore.App/2.0.0": {
      ...
        "compile": {
          "ref/netcoreapp2.0/Microsoft.CSharp.dll": {},
          "ref/netcoreapp2.0/Microsoft.VisualBasic.dll": {},
          "ref/netcoreapp2.0/Microsoft.Win32.Primitives.dll": {},
          "ref/netcoreapp2.0/System.AppContext.dll": {},
          "ref/netcoreapp2.0/System.Buffers.dll": {},
          "ref/netcoreapp2.0/System.Collections.Concurrent.dll": {},
          "ref/netcoreapp2.0/System.Collections.Immutable.dll": {},
          "ref/netcoreapp2.0/System.Collections.NonGeneric.dll": {},
          "ref/netcoreapp2.0/System.Collections.Specialized.dll": {},
          "ref/netcoreapp2.0/System.Collections.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.Annotations.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.Composition.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.DataAnnotations.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.EventBasedAsync.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.Primitives.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.TypeConverter.dll": {},
          "ref/netcoreapp2.0/System.ComponentModel.dll": {},
          "ref/netcoreapp2.0/System.Configuration.dll": {},
          "ref/netcoreapp2.0/System.Console.dll": {},
          "ref/netcoreapp2.0/System.Core.dll": {},
          "ref/netcoreapp2.0/System.Data.Common.dll": {},
          "ref/netcoreapp2.0/System.Data.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.Contracts.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.Debug.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.DiagnosticSource.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.FileVersionInfo.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.Process.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.StackTrace.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.TextWriterTraceListener.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.Tools.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.TraceSource.dll": {},
          "ref/netcoreapp2.0/System.Diagnostics.Tracing.dll": {},
          "ref/netcoreapp2.0/System.Drawing.Primitives.dll": {},
          "ref/netcoreapp2.0/System.Drawing.dll": {},
          "ref/netcoreapp2.0/System.Transactions.Local.dll": {},
          "ref/netcoreapp2.0/System.Transactions.dll": {},
          "ref/netcoreapp2.0/System.ValueTuple.dll": {},
          "ref/netcoreapp2.0/System.Web.HttpUtility.dll": {},
          "ref/netcoreapp2.0/System.Web.dll": {},
          "ref/netcoreapp2.0/System.Windows.dll": {},
          "ref/netcoreapp2.0/System.Xml.Linq.dll": {},
          "ref/netcoreapp2.0/System.Xml.ReaderWriter.dll": {},
          "ref/netcoreapp2.0/System.Xml.Serialization.dll": {},
          "ref/netcoreapp2.0/System.Xml.XDocument.dll": {},
          "ref/netcoreapp2.0/System.Xml.XPath.XDocument.dll": {},
          "ref/netcoreapp2.0/System.Xml.XPath.dll": {},
          "ref/netcoreapp2.0/System.Xml.XmlDocument.dll": {},
          "ref/netcoreapp2.0/System.Xml.XmlSerializer.dll": {},
          "ref/netcoreapp2.0/System.Xml.dll": {},
          "ref/netcoreapp2.0/System.dll": {},
          "ref/netcoreapp2.0/WindowsBase.dll": {},
          "ref/netcoreapp2.0/mscorlib.dll": {},
          "ref/netcoreapp2.0/netstandard.dll": {}
        },

Note that System.Runtime is absent.

Now, if I look at the log file, I see RAR is finding System.Runtime.dll inside the package.

Unified Dependency "System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". (TaskId:17)
...
Resolved file path is "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.dll". (TaskId:17)
Reference found at search path location "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0". (TaskId:17)
...
                     Output Item(s): 
                         ReferenceDependencyPaths=
                             C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.dll

This makes me think it is unlikely that the package folder is incomplete, since MSBuild is able to see the files in there, just not NuGet. Perhaps it has to do with a difference between the nupkg file and the expanded file layout (nuget may be looking at the nupkg). I imagine this could happen if the setup operation that creates the fallback folder was interrupted. That's actually consistent with an error message I'm seeing in your screenshot (which @Petermarcu pointed out to me) : Permissions denied to modify the ... Do you think you can rename C:\Program Files\dotnet\sdk\NuGetFallbackFolder then run dotnet new (or restore, build, etc) command from an elevated command prompt to see if that fixes the issue? /cc @wli3

If so, then I think a fix here to make this a less broken error would be to make the NuGetFallbackFolder more transactional: extract to temp folder then rename on completion.

@emgarten
Copy link
Member

emgarten commented Sep 5, 2017

@NikasZalias also try removing all obj folders also and restoring again, this will force restore to read the package directory again for the file list.

@hakonrossebo
Copy link

I had the same issue. A new class library build failed. The issue was fixed by renaming C:\Program Files\dotnet\sdk\NuGetFallbackFolder and deleting obj/bin folders for the project.

@vvsotnikov
Copy link

I had the same issue, a new console application build failed. I've tried the fix that @hakonrossebo did, but it didn't work for me. I've also tried to reinstall .NET Core SDK 2.0 and to repair my VS 2017, but without any success.

@dsplaisted
Copy link
Member

@bubert Can you provide the same information we asked Nikas for? IE, what errors you're seeing, whether you can successfully build from the command line, and a zip of your project with a log? You can create a binary log with the /bl argument, which is easier for us to investigate than an /flp:v=diag log. You might want to create a separate issue for all this, since it seems like the original issue reported here has been fixed.

@vvsotnikov
Copy link

@dsplaisted I've got exactly the same errors in IDE and when called dotnet restore as a Nikas, dotnet --version also returned 2.0.0. However, completely removing the IDE and .NET Core 2.0 SDK and installing them from scratch fixed the error, but now I can't reproduce it and provide the logs, sorry. Anyway, thank you for your response!

@joeseggie
Copy link

@ericstj thank you, saved my week. I got the same problem. Renaming the NuGetFallbackFolder, deleting the bin and obj folders from the project, running dotnet restore from command prompt with elevated privileges resolved the problem.

@Petermarcu
Copy link
Member

Looks like this issue can be closed as folks have identified a work around. @emgarten so you need an issue to track root causing this?

@emgarten
Copy link
Member

emgarten commented Oct 6, 2017

@Petermarcu I've opened NuGet/Home#5995 to track this

@Petermarcu
Copy link
Member

Thanks. I'll close this one then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants