-
Notifications
You must be signed in to change notification settings - Fork 41
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
Updating to 3.11-preview1 fails #139
Comments
This is a bug in the nuget package listing. 4.6.1 is not a supported framework, so the package shouldn't work. 4.6.2 is the minimum framework version for the 3.11 package. The nuget listing says 4.6 though. :( The listing will be updated to 4.6.2 in future updates. |
And what about the error when the project is switched to 4.8 before updating the package? Here, the package is updated after migration, but the DLL is also locked before. |
Sorry, I kind of skimmed over that part. I figured the missing updated reference was the main issue. To be honest, I don't know why that error appears. Obviously it appears that somebody has locked the file. I don't think it's us. It might be a third party tool or AV or something? (NuGet/Home#1458) I haven't seen this in my personal upgrade testing. Does this happen consistently? Do you have a small repro you can share? |
Disabling all third party extensions and the virus scanner did not make a change. But I think I have an explanation now: the problem seems to be caused by the fact that my sample zip does not contain the subdir "packages". It does not happen when: So, this might be a NuGet issue. But it is probably not a realistic scenario - I should have added the "packages" dir to the zip. By the way: installing 3.11 to the 4.6.1 project also works ;-). |
My apologies. My reading comprehension was not very good last week apparently. :( You did have a repro project and steps laid out and I missed it. Anyway, looking closer at this today, I can see what's going on now. In your case, msbuild.exe (spawned by VS when you build) has loaded our build tasks dll (introduced in 3.6 because inline 'CodeTaskFactory' is not supported by 'dotnet msbuild' which runs on .Net Core even though it can compile netstandard projects - see #51 and #92) and thus the task dll can't be deleted when uninstalling the 3.6 package. However, VS does keep track of this failure and will remove the old package after restarting. So at the end of the day everything works out fine despite the scary warning bar. This isn't a new or unique to this package issue unfortunately. Here are some other threads I've come across while looking into this issue:
Seems like there has been some effort to fix this in the 'dotnet msbuild', but not the normal msbuild VS uses. If this were truly a breaking/blocking issue, it sounds like it might be possible to bring our custom tasks back inline and choosing between 'CodeTaskFactory' and 'RoslynCodeTaskFactory' using mechanisms similar to those employed in this blog post. But I remember considering 'RoslynCodeTaskFactory' when I was working on #51 and was running into a whole host of other problems with that approach. (I don't remember what those issues were off the top of my head. Maybe something like what is discussed in this thread?) We also can't take the wrapper approach described in some of those linked threads since the wrapper would have to be declared in either another .dll that we still can't unload, or an inline code task which brings us back to #51. There are a few things that can be done to avoid or resolve the issue:
|
Thanks for the detailed analysis! Yes, "PackageReferences" would be preferred, but just for the recoed: it does not work for old style Web projects. |
@WolfgangHG PackageReference can be used with Web Application Projects (ASP.Net 4.x) - I'm not sure if you meant Web Site projects (where I think you are correct). |
Use the sample attached to #113 (it is a 4.6.1 project), compile it and update the Nuget package to 3.11-preview1.
This fails for me with an error:
The package at '...\RoslynTest\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0' failed to uninstall. Restart Visual Studio to finish the process.
Restarting VS does not work, as the project is broken afterwards: "packages.config" has already an entry for the new version, but the project reference is missing.
It works better if I update the sample project to 4.8 before - now the same error is shown by VS, but the project reference is present after restarting VS.
It would probably work if I used a package reference instead of "packages.config".
Do you have any idea? Is this something that can be fixed?
Here is the output of Nuget console - the file "DotNetCompilerPlatformTasks.dll" is locked:
The text was updated successfully, but these errors were encountered: