NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

2.8.6 doesn't work on .NET 4.0 #1287

Closed deepakaravindr closed 9 years ago

deepakaravindr commented 9 years ago

@zapov

..\NuGet.exe Pack Project.nuspec Checking for updates from https://www.nuget.org/api/v2/. Currently running NuGet.exe 2.8.5. Updating NuGet.exe to 2.8.6. Update successful. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as sembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e 089'.

yishaigalatzer commented 9 years ago

We need to decide if we require .NET 4.5 on the user machine to run or not.

CC @csharpfritz

Antiohne commented 9 years ago

I also ran into this problem within my company. When I upgraded one of our solutions to use NuGet 2.8.6 and build that particular project I get the following error message:

"Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

I don't understand why there is a .NET framework change (4.0 > 4.5) introduced in a patch level version of NuGet 2. This is a breaking change for us because we can't upgrade our BizTalk 2010 solutions to the .NET 4.5 level. This framework version is not supported by BizTalk 2010.

According to the semantic versioning rules this change only should be introduced in a major version of NuGet. A dependency change on the .NET framework is for me an incompatible API change.

Given a version number MAJOR.MINOR.PATCH, increment the: 1.MAJOR version when you make incompatible API changes, 2.MINOR version when you add functionality in a backwards-compatible manner, and 3.PATCH version when you make backwards-compatible bug fixes.

richardschneider commented 9 years ago

I'm just running .Net 4.0 and get the above error. Here's some background info I found Stackoverflow.

yishaigalatzer commented 9 years ago

At this point we realize this was a breaking change, but we are not going to go back and fix 2.8.6, you can use 2.8.5 or update to 3.2.1 (or newer) and move to .NET 4.5.

We will eventually produce a version of NuGet.exe that runs on core clr, and that would be independent from the .NET installed on the user's machine.

For now I'm closing this as Won't fix, with the plan to produce an .net independent nuget

4nd3250n commented 9 years ago

How to downgrade to 2.8.5 ? Info on this would be most welcome.

yishaigalatzer commented 9 years ago

Download the nuget package nuget.commandline version 2.8.5 from nuget.org

Sent from my Windows Phone


From: 4nd3250nmailto:notifications@github.com Sent: ‎11/‎6/‎2015 1:22 AM To: NuGet/Homemailto:Home@noreply.github.com Cc: Yishai Galatzermailto:yigalatz@microsoft.com Subject: Re: [Home] 2.8.6 doesn't work on .NET 4.0 (#1287)

How to downgrade to 2.8.5 ? Info on this would be most welcome.

— Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fNuGet%2fHome%2fissues%2f1287%23issuecomment-154353346&data=01%7c01%7cyigalatz%40microsoft.com%7c2116c27c91764c13b32208d2e68bcada%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=8bK928Nl8jIrCB%2bwwANG5r9pVo1O9he8gm8259pvAm8%3d.

4nd3250n commented 9 years ago

Will this fix iz or must something else be done also? Because in my case it did not. Still no build.

feiling commented 9 years ago

Please try nuget 2.9. You can get it from https://www.myget.org/F/nuget-volatile/api/v2/package/NuGet.CommandLine/2.9.0. After you get the file, unzip it, and you'll find nuget.exe under directory tools.

4nd3250n commented 9 years ago

Hi. I have tried it with mixed results. MSBuild command line now build my project without nuget related errors. Visual studio does not build nor individual projects nor complete solution. To make worse it does not report any error.

Thank you for 2.9 notification.

yishaigalatzer commented 9 years ago

What version of visual studio are you using? And what do you mean by doesn't build?

We recommend that you avoid using msbuild to restore your packages, please read on package restore here: http://docs.nuget.org/consume/package-restore

Sent from my Windows Phone


From: 4nd3250nmailto:notifications@github.com Sent: ‎11/‎7/‎2015 7:45 AM To: NuGet/Homemailto:Home@noreply.github.com Cc: Yishai Galatzermailto:yigalatz@microsoft.com Subject: Re: [Home] 2.8.6 doesn't work on .NET 4.0 (#1287)

Hi. I have tried it with mixed results. MSBuild command line now build my project without nuget related errors. Visual studio does not build nor individual projects nor complete solution. To make worse it does not report any error.

Thank you for 2.9 notification.

— Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fNuGet%2fHome%2fissues%2f1287%23issuecomment-154717067&data=01%7c01%7cyigalatz%40microsoft.com%7c80b9f310a4864b68d13d08d2e78a8135%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=sJouQrtbpWII3%2feM8lGvZX9jbZg9FUCWJVN%2fHHNuVm4%3d.

4nd3250n commented 9 years ago

Visual Studio 2010 And by doesn't build I mean I get this message in output window:

------ Rebuild All started: Project: MyProject, Configuration: Debug Any CPU ------ ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

And no other error or warning. i have set output options to detail

I will clarify a bit, although this is somewhat out of place here. It all started when I got some error, can't remember what it was exactly something like 0x800... Upon all following builds I got the fail message above. Therefore I tried command line MSBuild to build my project just to get some output. And I did. It was as above:

"Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly >'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

Your NuGet 2.9 suugestion helped in a sense that MSBuild now builds my project. From command line of course which is impractical. If I try build/rebuild/clean from visual studio in gives just this "1 failed" message with no further info. It also completes very quickly so I guess the build doesn't even start. I think this is not related to NuGet anymore. I just wrote this as a brief explanation and to clarify it for you.

yishaigalatzer commented 9 years ago

You probably have a version of nuget in your .nuget solution folder that fails to load. Try dir /s nuget.exe from the solution level on the commandline

Sent from my Windows Phone


From: 4nd3250nmailto:notifications@github.com Sent: ‎11/‎7/‎2015 9:29 AM To: NuGet/Homemailto:Home@noreply.github.com Cc: Yishai Galatzermailto:yigalatz@microsoft.com Subject: Re: [Home] 2.8.6 doesn't work on .NET 4.0 (#1287)

Visual Studio 2010 And by doesn't build I mean I get this message in output window: ------ Rebuild All started: Project: MyProject, Configuration: Debug Any CPU ------ ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== And no other error or warning. i have set output options to detail

I will clarify a bit, although this is somewhat out of place here. It all started when I got some error, can't remember what it was exactly something like 0x800... Upon all following builds I got the fail message above. Therefore I tried command line MSBuild to build my project just to get some output. And I did. It was as above:

"Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly >'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'." Your NuGet 2.9 suugestion helped in a sense that MSBuild now builds my project. From command line of course which is impractical. If I try build/rebuild/clean from visual studio in gives just this "1 failed" message with no further info. It also completes very quickly so I guess the build doesn't even start. I think this is not related to NuGet anymore. I just wrote this as a brief explanation and to clarify it for you.

— Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fNuGet%2fHome%2fissues%2f1287%23issuecomment-154726217&data=01%7c01%7cyigalatz%40microsoft.com%7c3a658c21ba4f4f6de9fc08d2e7990bdc%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=L%2fyM8CRqIOHrk07x37ZYhMeu5wMNcbzrn%2bDhVk28eSg%3d.

4nd3250n commented 9 years ago

The dir /s nuget.exe result is

Directory of D:\Visual Studio\Projects\MySolution\.nuget
11.09.2015  12:49         1.697.280 NuGet.exe
           1 File(s)      1.697.280 bytes
Directory of D:\Visual Studio\Projects\MySolution\packages\NuGet.CommandLine.2.9.0\tools
07.11.2015  14:29         1.697.280 NuGet.exe
           1 File(s)      1.697.280 bytes

 Total Files Listed:
           2 File(s)      3.394.560 bytes
           0 Dir(s)   7.377.006.592 bytes free
yishaigalatzer commented 9 years ago

Try following the link I sent before


From: 4nd3250nmailto:notifications@github.com Sent: ‎11/‎7/‎2015 9:38 AM To: NuGet/Homemailto:Home@noreply.github.com Cc: Yishai Galatzermailto:yigalatz@microsoft.com Subject: Re: [Home] 2.8.6 doesn't work on .NET 4.0 (#1287)

The dir /s nuget.exe result is

Directory of D:\Visual Studio\Projects\MySolution.nuget 11.09.2015 12:49 1.697.280 NuGet.exe 1 File(s) 1.697.280 bytes Directory of D:\Visual Studio\Projects\MySolution\packages\NuGet.CommandLine.2.9.0\tools 07.11.2015 14:29 1.697.280 NuGet.exe 1 File(s) 1.697.280 bytes

Total Files Listed: 2 File(s) 3.394.560 bytes 0 Dir(s) 7.377.006.592 bytes free

— Reply to this email directly or view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fNuGet%2fHome%2fissues%2f1287%23issuecomment-154728709&data=01%7c01%7cyigalatz%40microsoft.com%7c8d86ee4d99f24a80e10808d2e79a2ffc%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=42Rw6TiUrsaV%2fFgqXJmvhoUXHm1Uirc594edKWal%2b%2bM%3d.

4nd3250n commented 9 years ago

I am not sure what you are getting at. But i have disabled those two options

Visual Studio is configured to 'Allow NuGet to download missing packages' Visual Studio is configured to 'Automatically check for missing packages during build in Visual Studio'

Same result. Build failed. As I said I dont think this is related anymore to

Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as sembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e 089'.

As much as I would love to have my problem fix I also don't like the idea to clutter this issue with something that may not be related anymore.