Errors in deploying

Hi everyone,
We’re having some issues after an upgrade to 3.2.7
We can build the product successfully, but on deploying to Octopus we see the following errors in the build log.
Any suggestions would be greatly appreciated.

Built $/FullSolutionPath/SNProject/SNProject.csproj for default targets. Cannot add part for the specified URI because it is already in the package.
There was an error calling NuGet. Please see the output above for more details. Command line: ‘Z:\BuildPath\packages\OctoPack.3.0.45\tools\NuGet.exe’ pack “Z:\BuildPath\WebProject\obj\octopacking\WebProject.nuspec” -NoPackageAnalysis -BasePath “Z:\BuildPath\WebProject” -OutputDirectory “Z:\BuildPath\WebProject\obj\octopacked” -Version 1.0.5850.28175
System.Exception: There was an error calling NuGet. Please see the output above for more details. Command line: ‘Z:\BuildPath\packages\OctoPack.3.0.45\tools\NuGet.exe’ pack “Z:\BuildPath\WebProject\obj\octopacking\WebProject.nuspec” -NoPackageAnalysis -BasePath “Z:\BuildPath\WebProject” -OutputDirectory “Z:\BuildPath\WebProject\obj\octopacked” -Version 1.0.5850.28175 at OctoPack.Tasks.CreateOctoPackPackage.RunNuGet(String specFilePath, String octopacking, String octopacked, String projectDirectory) in y:\work\1f6ae101e1fcba62\source\OctoPack.Tasks\CreateOctoPackPackage.cs:line 551 at OctoPack.Tasks.CreateOctoPackPackage.Execute() in y:\work\1f6ae101e1fcba62\source\OctoPack.Tasks\CreateOctoPackPackage.cs:line 196
MSBuild Log File
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I actually just ran into this today as well. I looked at the logs and it appeared that when OctoPack was building my nuget package, it added my Telerik.Web.UI.dll twice to the package.
I think it was confused because I had the dll in the bin folder, and included in the project, and then referenced that dll. The change I made that fixed the issue was to move that dll out to a different folder then bin (in my case, ExternalDLLs) and make the references point there, and make sure they said “Copy Local” = true.

I have other projects that are setup the same way and haven’t had an issue, but I’m not sure if the Octopack version is different (this project was from today)

anyway, hope that helps!

Hi Stephane,

Ben’s tip is a good one (thanks Ben). Does this assist with your problem?

Regards,
Michael

From the dev experiencing the issue

It’s not 100% applicable to us as I believe there are no Dlls in any projects in our solution that are both put in the bin folder and referenced at the same time.

Now I had to add two dlls to one of the project as compared to the solution that was deploying fine before. In this case I was not able to refer the dlls to the application so I have added them to the project and set “Copy to Output Directory” as ‘Copy Always’. I suspect one of these dlls might be causing this issue but it’s hard to say as the error message does not point to a specific file.

Stephane,

Yes, these can be a little tricky to track down, as the error is actually coming from NuGet.

This StackOverflow question contains a few suggestions for resolving the problem. If you examine the generated .nuspec file, it may also give you a clue.

Please let me know if this doesn’t help.

Regards,
Michael

Ok, we think we tracked down the errors.
We’ve removed all the dll’s in question from the .nuspec and added them as references inside the projects and it seems to have cleared the error.

That’s great to hear Stephane. I’m glad it’s resolved.

Happy Deployments!