Home: NuGet.Build.Tasks.Pack.dll shipped delay signed in VS2017 (d15rel 26014.00)

Created on 17 Dec 2016  路  17Comments  路  Source: NuGet/Home

On a machine without \\vspreinstall\preinstall\preinstall having run:

Create a .NET Core project.
Try to package it.
The build fails because NuGet.Build.Tasks.Pack.dll is delay or test signed:

Could not load file or assembly 'NuGet.Build.Tasks.Pack, Version=4.0.0.0, Culture=neutral, PublicKeyTo
ken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed.

msbuild /t:pack
聽 ConsoleApp1 -> C:\Users\andre\OneDrive\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp1.0\ConsoleApp1.dll
聽 ConsoleApp1 -> C:\Users\andre\OneDrive\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\bin\Debug\net46\ConsoleApp1.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(73,5): error MSB4062:
聽The "NuGet.Build.Tasks.Pack.PackTask" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\NuGet.Build.T
asks.Pack\buildCrossTargeting\..\Desktop\NuGet.Build.Tasks.Pack.dll. Could not load file or assembly 'NuGet.Build.Tasks.Pack, Version=4.0.0.0, Culture=neutral, PublicKeyTo
ken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) Confirm that the <UsingTask> declaration is correct,
that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Users\andre\OneDri
ve\Documents\Visual Studio 2017\Projects\ConsoleApp1\ConsoleApp1\ConsoleApp1.csproj]
Pack 2 Bug

Most helpful comment

@xwipeoutx: one workaround is to execute this from an elevated VS Developer Prompt

sn -Vr NuGet.Build.Tasks.Pack,31bf3856ad364e35
sn -Vr NuGet.Commands,31bf3856ad364e35

the same for any other assemblies that have this problem.

But be sure to unregister them later (using sn -Vu) after the bug is fixed.

All 17 comments

Apparently at least one other assembly is also not fully signed: NuGet.Commands

Is there a workaround for this if we've already installed it?

@xwipeoutx: one workaround is to execute this from an elevated VS Developer Prompt

sn -Vr NuGet.Build.Tasks.Pack,31bf3856ad364e35
sn -Vr NuGet.Commands,31bf3856ad364e35

the same for any other assemblies that have this problem.

But be sure to unregister them later (using sn -Vu) after the bug is fixed.

@rohit21agrawal looked at RC2 (not RC2.1) and believes that those DLLs are properly signed there. He'll continue to dig into it to make sure RC3 has this addressed.

i have replaced the culprit unsigned nuget package on the nuget-build (and cli-deps) feed on myget. The next nightly build should pick up the right package and have signed DLLs

verified with jacques from the WTE team that the build is picking up the signed nupkg now. tomorrow's build will not have this issue. closing this issue.

I just installed VS 2017 RC and got this bug, does that make sense?

@davghouse can you tell us the build number?

Go to Help -> About Microsoft Visual Studio

Microsoft Visual Studio Professional 2017 RC
Version 15.0.26020.0 D15REL
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

NuGet Package Manager 4.0.0

@davghouse this build is over a month old, and yes it did have this problem. could you try updating your VS?

@rohit21agrawal Okay I looked around but I appear to have the latest version based off of https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes. I'm not very familiar with VS, should I look somewhere else?

@davghouse my bad.. wait for a few days for the next update..and use the work around mentioned in the post above until then.

Hi Team,

We are getting same error in out TFS 2017 build. Builds were working fine till last week. Not sure what went wrong. All builds are failing with below error.

D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets (104, 5)
The "NuGet.Build.Tasks.Pack.PackTask" task could not be loaded from the assembly D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\NuGet.Build.Tasks.Pack\build..\CoreCLR\NuGet.Build.Tasks.Pack.dll. Could not load file or assembly 'NuGet.Commands, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621) Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Solutions are building successfully on developers machines.
Any help or suggestions would be more helpful.

Thanks,
Shree

@ShreeSam this looks like the issue logged at https://github.com/dotnet/sdk/issues/1384

Hi dasMulli,

No. We are not getting any System.IO error.

Thanks,
Shree

@ShreeSam can you provide details of the Visual Studio version you are using?

Hi Rohit,

Please find the attached screenshot.

image

Thanks,
Shree

Was this page helpful?
0 / 5 - 0 ratings