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

[Mono] NuGet version too old on Linux #2027

Closed
grendello opened this issue Nov 24, 2020 · 4 comments · Fixed by #2034
Closed

[Mono] NuGet version too old on Linux #2027

grendello opened this issue Nov 24, 2020 · 4 comments · Fixed by #2034

Comments

@grendello
Copy link
Contributor

Hi,

I use omnisharp-roslyn with Emacs on Linux and because Mono bundled with omnisharp doesn't have any other .NET SDKs than 4.5 (and I mostly work with 4.7.2 these days),
I tend to modify the run script to start omnisharp with my locally built Mono from the master branch. Until recently it's been working fine, but with the latest update to MSBuild
16.8, it broke with:

[16:27:28] ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash) [0x0003a] in <1362f3759017415f99456b8adb293671>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task) [0x00015] in <1362f3759017415f99456b8adb293671>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups () [0x00000] in <1362f3759017415f99456b8adb293671>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore () [0x00018] in <1362f3759017415f99456b8adb293671>:0 
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x0002e] in <1362f3759017415f99456b8adb293671>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <f7274894ce154696afba1f0ffcd06434>:0 
  at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002fc] in <f7274894ce154696afba1f0ffcd06434>:0

It appears that NuGet 5.2.0 which is used by omnisharp is too old. I fixed it by updating nuget to 5.8.0 (the latest) and rebuilding omnisharp. Everything works perfectly now :)
I tested it only on Linux but I suppose the same might be true on macOS.

Could you please update NuGet to the above-mentioned version? I'm happy to open a PR if needed. Thanks :)

@RealityAnomaly
Copy link

Same issue here.

grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Dec 7, 2020
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Jan 4, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Jan 12, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Jan 28, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Feb 15, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Mar 19, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Mar 30, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
@JordanAnthonyKing
Copy link

JordanAnthonyKing commented Apr 11, 2021

I seem to be having a similar issue? Also on Emacs using omnisharp-roslyn via lsp-mode. Mine is a .NET Core 3.1 project:

OmniSharp.MSBuild.ProjectLoader: The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder'.
  at NuGet.Packaging.FallbackPackagePathResolver..ctor (System.String userPackageFolder, System.Collections.Generic.IEnumerable`1[T] fallbackPackageFolders) [0x00064] in <665a1c83623344819944d40680140855>:0 
  at Microsoft.NET.Build.Tasks.NuGetPackageResolver..ctor (System.String userPackageFolder, System.Collections.Generic.IEnumerable`1[T] fallbackPackageFolders) [0x00006] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver (System.Collections.Generic.IEnumerable`1[T] packageFolders) [0x00018] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver (NuGet.ProjectModel.LockFile lockFile) [0x0002a] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheWriter..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task) [0x00030] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash) [0x0003a] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task) [0x00015] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups () [0x00000] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore () [0x00018] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x0002e] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <ea47b2df30ad4051b6681ba57ba83dc9>:0 
  at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002fc] in <ea47b2df30ad4051b6681ba57ba83dc9>:0  | 
OmniSharp.MSBuild.ProjectLoader: The "ResolvePackageAssets" task failed unexpectedly.
NuGet.Packaging.Core.PackagingException: Unable to find fallback package folder 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder'.
  at NuGet.Packaging.FallbackPackagePathResolver..ctor (System.String userPackageFolder, System.Collections.Generic.IEnumerable`1[T] fallbackPackageFolders) [0x00064] in <665a1c83623344819944d40680140855>:0 
  at Microsoft.NET.Build.Tasks.NuGetPackageResolver..ctor (System.String userPackageFolder, System.Collections.Generic.IEnumerable`1[T] fallbackPackageFolders) [0x00006] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver (System.Collections.Generic.IEnumerable`1[T] packageFolders) [0x00018] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.NuGetPackageResolver.CreateResolver (NuGet.ProjectModel.LockFile lockFile) [0x0002a] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheWriter..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task) [0x00030] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash) [0x0003a] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task) [0x00015] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups () [0x00000] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore () [0x00018] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x0002e] in <c1a29c5daf134e4ba6d73cbbae7974d1>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <ea47b2df30ad4051b6681ba57ba83dc9>:0 
  at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002fc] in <ea47b2df30ad4051b6681ba57ba83dc9>:0  | 

Is this related?

@JoeRobich
Copy link
Member

@JordanAnthonyKing It doesn't seem to be the same issue. Can you confirm that the folder 'C:\Program Files\dotnet\sdk\NuGetFallbackFolder' exists?

@JordanAnthonyKing
Copy link

@JoeRobich Hi, I eventually figured this out as a misnomer for an incorrectly configured project.

Thanks

grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Apr 20, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue May 19, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.8.0 makes the issue
disappear.
grendello added a commit to grendello/omnisharp-roslyn that referenced this issue Jul 22, 2021
Fixes: OmniSharp#2027

Fixes the following exception when using OmniSharp on Linux (with Emacs,
but possibly breaks with other LSP clients as well):

    ERROR: OmniSharp.MSBuild.ProjectLoader, The "ResolvePackageAssets" task failed unexpectedly.
    System.MissingMethodException: Method not found: NuGet.ProjectModel.LockFileTarget NuGet.ProjectModel.LockFile.GetTarget(string,string)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader.CreateReaderFromDisk (Microsoft.NET.Build.Tasks.ResolvePackageAssets task, System.Byte[] settingsHash)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets+CacheReader..ctor (Microsoft.NET.Build.Tasks.ResolvePackageAssets task)
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups ()
      at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore ()
      at Microsoft.NET.Build.Tasks.TaskBase.Execute ()
      at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute ()
      at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask)

Currently used NuGet 5.2.0 is too old, update to 5.10.0 makes the issue
disappear.
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

Successfully merging a pull request may close this issue.

4 participants