OctoPack error with XML files containing backquotes

I’m getting an error when octopack tries to create the nuspec file for files that use backquotes to specify method names for generics.

Here’s the final error. Any ideas why these files would create a problem?

Thanks,

John Spinosa

error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Helpers.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.WebHost.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.Razor.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Deployment.xml' contains invalid characters. 
error OCTONUGET: Target path 'C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies\System.Web.WebPages.Razor.xml' contains invalid characters. 
error OCT-1676060969: There was an error calling NuGet. Please see the output above for more details. Command line: 'D:\Limeade\Source\OctopusDeploy\src\packages\OctoPack.3.0.20\tools\NuGet.exe' pack "D:\Limeade\Source\OctopusDeploy\src\Limeade.UI.Web\obj\octopacking\Limeade.UI.Web.nuspec"  -NoPackageAnalysis -BasePath "D:\Limeade\Source\OctopusDeploy\src\Limeade.UI.Web" -OutputDirectory "D:\Limeade\Source\OctopusDeploy\src\Limeade.UI.Web\obj\octopacked" -Version 1.0.0.0 
error OCT-1676060969: System.Exception: There was an error calling NuGet. Please see the output above for more details. Command line: 'D:\Limeade\Source\OctopusDeploy\src\packages\OctoPack.3.0.20\tools\NuGet.exe' pack "D:\Limeade\Source\OctopusDeploy\src\Limeade.UI.Web\obj\octopacking\Limeade.UI.Web.nuspec"  -NoPackageAnalysis -BasePath "D:\Limeade\Source\OctopusDeploy\src\Limeade.UI.Web" -OutputDirectory "D:\Limeade\Source\OctopusDeploy\src\Limeade.UI.Web\obj\octopacked" -Version 1.0.0.0
   at OctoPack.Tasks.CreateOctoPackPackage.RunNuGet(String specFilePath, String octopacking, String octopacked, String projectDirectory)
   at OctoPack.Tasks.CreateOctoPackPackage.Execute() 
Project src\Limeade.UI.Web\Limeade.UI.Web.csproj failed.

Hi John,

I don’t suppose you could attach a copy of your .csproj file? It looks like you have some referenced assemblies that aren’t set to copy local, and for some reason we’re trying to use an absolute path to them.

Paul

I could, but it can’t be published in this forum.

If I attach it, will it be published to the public thread?

John

Test

TestReg.txt (497 Bytes)

I’m seeing the same issue. However limited down to just the System.Net.Http.Formatting reference. My solution contains 36 projects, 4 of which reference System.Net.Http.Formatting. Each of these are set to ‘Local Copy’=true and each is pathed to a NuGet packages folder. I’m using OctoPack v3.0.20.

I’ve proven that the OctoPack-built nuspec file contains the following:

    <file src="C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.xml" target="C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.xml" />

Is there any dependency tree walking done by OctoPack? Should I be focusing on project references that reference System.Net.Http.Formatting? Any other thoughts?

My preview post didn’t contain the NuSpec issue. I’ve attached here. Note the src/targe t of the System.Net.Http.Formatting file.

Nuspec-issue.nuspec (686 Bytes)

I switched all the problem DLLs from copy local = true to copy local = false and this fixed the build issue. Thanks for the tip!

John

I read through the nuspec file and noticed that the src and target attributes are the same. I don’t see what conclusion I should draw from that information.

John

When you are building with TeamCity/MSBuild, are there any special parameters that you pass to tell MSBuild to use a different output directory?

Would it be possible to see the entire MSBuild output? You can email it and your .csproj file to paul at octopusdeploy.com

Paul

Also, what versions of Visual Studio/.NET are you targeting?

Is this helpful?

10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)

Also, we are running VS12 and we are targeting ver 4.5 of .NET

I e-mailed Paul at octopusdeploy.com as well.

To supply more information and keep this thread alive, we’re also running VS12 and targeting .NET v4.5, too. The project’s output path is not the traditional bin\ folder but a subfolder of bin. (i.e. bin\FeatureRelease).

Additionally, OctoPack works fine for two other projects in the same solution but gives this failure on the ASP.NET project (that references other assembly projects in the solution). The problematic references failing in the ASP.NET project are to be found in other projects. To me it appears to be something related to the ASP.NET configuration.

Correction. The other two projects that work fine are also ASP.NET projects. However, both projects output path is to the traditional bin\ folder.

Thanks all, I’m going to look into this again today.

Paul

Hi,

Thanks for sending me all this information; I’m just not having any luck reproducing this one.

How are you compiling this solution? I saw that you were using TeamCity John. What does the runner look like? Do you pass any parameters to MSBuild? Are you doing anything special, like performing a web application “publish”? Building in release mode? Debug mode? Setting OutDir? Do you pass anything to OutDir? Is Visual Studio installed on your build server?

With OctoPack installed, can you go to your solution directory, and simply run (on your workstation and on the build server):

MSBuild.exe YourSolution.sln /p:RunOctoPack=true /t:Build /p:Configuration=Release

With no other parameters and tell me what you get?

Thanks again,

Paul

Hi, Paul.

Answering your questions you sent to John from my perspective. Yes, one of the actions is to publish the web application via MSDeploy. We’re building a custom ‘FeatureDevelopment’ configuration. And the output directory is bin/FeatureDevelopment/.

Just to add some information based on my own experiences; the MSBuild solution files produced in TeamCity seem to have problems with file copying that don’t appear when building with Visual Studio directly.

Can anyone on the thread confirm whether the issue appears when building from Visual Studio on a dev machine?

Cheers,
Nick

Hi, Nick.

No, I cannot duplicate the issue in Visual Studio directly. It seems that TFS has to be in the mix.

Thanks for keeping this thread alive.
Paulb