Exception in VS 2019 during publish after updating to 2.0.48 (Method not found CacheService.get_CacheFolder()) #481
Exception occurred in VS 2019 (16.0.4) after updating to
Running it locally doesn't produce this error.
Publishing it with VS 2017 doesn't produce the error.
changed the title
Exception during publish after updating to 2.0.48 (Method not found CacheService.get_CacheFolder())
May 17, 2019
@NikolayIT can you give a little more specifics about the action that doesn't work vs what does? The error is from the build package, so I'm trying to understand:
I was able to reproduce this (or technically, the reverse version of it that I mention below). The issue occurs because during publish, VS does a build where it hosts MSBuild in-proc, which loads the Microsoft.Web.LibraryManager.Build.dll into the VS process. However, by this point, the other LibMan DLLs (specifically Microsoft.Web.LibraryManager.Contracts.dll and Microsoft.Web.LibraryManager.dll, which the Build.dll depends on)
The crux of this is that here was a breaking change in the 2.0.48 version (which is the version shipping in VS 16.1). This error occurs when you use the newer Build NuGetPackage in an older VS build while publishing through VS (or vice versa, you'll get a different MissingMethodException for a 16.1+ VS with the 1.0.172 Build package as well).
I'm looking into whether it's possible to make VS publish use an out-of-proc build. Other than the following workarounds, I don't think there's a good fix for this issue.
I have 16.1 Version But Still have same issue
C:\Users\irakl.nuget\packages\microsoft.web.librarymanager.build\1.0.172\build\Microsoft.Web.LibraryManager.Build.targets(35,9): Error MSB4018: The "Microsoft.Web.LibraryManager.Build.RestoreTask" task failed unexpectedly.
Line 35: <Microsoft.Web.LibraryManager.Build.RestoreTask