error OCTONUGET: Target path contains invalid characters.

Shyam's Avatar

Shyam

08 Sep, 2017 04:46 AM

Hi Team,

We are getting error while teamcity creates octopack in the teamcity.
Please find below log

[CreateOctoPackPackage] error OCTONUGET: Target path 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.Graph\15.0.0.0_71e9bce111e9429c\Microsoft.Office.Interop.Graph.dll' contains invalid characters.
[09:57:01][CreateOctoPackPackage] error OCTONUGET: Target path 'C:\Windows\assembly\GAC_MSIL\Microsoft.Office.Interop.PowerPoint\15.0.0.071e9bce111e9429c\Microsoft.Office.Interop.PowerPoint.dll' contains invalid characters.
[09:57:01][CreateOctoPackPackage] error OCTONUGET: Target path 'C:\Windows\assembly\GAC_MSIL\Microsoft.Vbe.Interop\15.0.0.0_71e9bce111e9429c\Microsoft.Vbe.Interop.dll' contains invalid characters.
[09:57:01][CreateOctoPackPackage] error OCT-1805672349: There was an error calling NuGet. Please see the output above for more details. Command line: 'E:\ProjectBuildDirectory\91b27f9720f85ff2\packages\OctoPack.3.0.33\tools\NuGet.exe' pack "E:\ProjectBuildDirectory\91b27f9720f85ff2\PackageName\obj\octopacking\PackageName.nuspec"  -NoPackageAnalysis -BasePath "E:\ProjectBuildDirectory\91b27f9720f85ff2\PackageName" -OutputDirectory "E:\ProjectBuildDirectory\91b27f9720f85ff2\PackageName" -Version 5.0.2302
[09:57:01]
[CreateOctoPackPackage] error OCT-1805672349: System.Exception: There was an error calling NuGet. Please see the output above for more details. Command line: 'E:\ProjectBuildDirectory\91b27f9720f85ff2\packages\OctoPack.3.0.33\tools\NuGet.exe' pack "E:\ProjectBuildDirectory\91b27f9720f85ff2\PackageName\obj\octopacking\PackageName.nuspec"  -NoPackageAnalysis -BasePath "E:\ProjectBuildDirectory\91b27f9720f85ff2\PackageName" -OutputDirectory "E:\ProjectBuildDirectory\91b27f9720f85ff2\PackageName" -Version 5.0.2302
   at OctoPack.Tasks.CreateOctoPackPackage.RunNuGet(String specFilePath, String octopacking, String octopacked, String projectDirectory) in y:\work\46cfb6001f03d701\source\OctoPack.Tasks\CreateOctoPackPackage.cs:line 538
   at OctoPack.Tasks.CreateOctoPackPackage.Execute() in y:\work\46cfb6001f03d701\source\OctoPack.Tasks\CreateOctoPackPackage.cs:line 195

Can you please check this why this error happening?
Regards,
Shyam

  1. Support Staff 1 Posted by Mark Siedle on 10 Sep, 2017 11:44 PM

    Mark Siedle's Avatar

    Hi Shyam,

    Thanks for getting in touch.

    We had a look in the discussion forums and there was a similar case reported several years ago here that may help.

    From what we can understand, Nuget.exe pack does not like referencing files in the GAC. I think you'll find if you just use the Nuget.exe pack command (which OctoPack just calls through to), the same error will occur, so the problem is with Nuget.exe.

    This other customer's solution was to copy the locally referenced Office GAC assemblies into a "lib" directory and referenced them in their project.

    Could you give their solution a try and let me know how you go.

    Hope this helps.

    Cheers
    Mark

  2. 2 Posted by Shyam on 11 Sep, 2017 05:07 AM

    Shyam's Avatar

    Hi Mark,

    Thank you for reply.
    I have already read that article but, I am not able to solve the problem. The problem is that in different machine Project builds get succeeded. Once I select second machine we got build error in teamcity.

    Can you please check that why it is not working in different machine?

    Regards,
    Shyam

  3. Support Staff 3 Posted by Mark Siedle on 11 Sep, 2017 05:32 AM

    Mark Siedle's Avatar

    Hi Shyam,

    Could you please clarify what you mean by you selecting a different machine? Do you mean another TeamCity build agent?

    That error you previously showed is when OctoPack is using nuget.exe to pack. If it's failing on that step for some build agents (but working on others), then it is a problem with that build agent and not something we can help with. You will have to investigate what is different about that build agent compared to the agent where it runs successfully.

    Did you try moving those libraries from the GAC and referencing them in your project as described in the other support issue? That may help it to work on any build agent.

    Cheers
    Mark

  4. Paul Stovell closed this discussion on 13 Dec, 2017 11:23 PM.

  5. Shyam re-opened this discussion on 25 May, 2018 08:27 AM

  6. 4 Posted by Shyam on 25 May, 2018 08:27 AM

    Shyam's Avatar

    Hi Mark,

    Sorry for the late reply.
    We have two different build agent on the different machines. However, it is getting failed. To solve this issue we have upgraded octopack to latest version. But, we still same error. We have not referenced this DLL with our project. Octopack is trying to copy this dll from GAC_MSIL library.

    Can you please help us on this as soon as possible?

    Regards,
    Shyam

  7. Support Staff 5 Posted by Mark Siedle on 27 May, 2018 11:32 PM

    Mark Siedle's Avatar

    Hi Shyam,

    If you are experiencing the same error with a reference to the GAC from MSOffice assemblies saying 'Microsoft.Office.Interop.PowerPoint.dll' contains invalid characters (specifically calling out "C:\Windows\assembly\GAC_MSIL"), then there's something about your project that is referencing those GAC assemblies...

    They may be indirect references (if you haven't added them). I.e. You're referencing a Microsoft assembly that has then added those references to GAC assemblies. You will need to investigate what's causing a reference to those things in your project before that NuGet command will be able to complete (and instead moving them to a locally referenced version instead).

    If this error is only occurring on one of your build agent machines (as you previously mentioned), then you will need to see what's different about the agent-machine where the command is failing (in terms of those GAC assemblies).

    Sorry we can't be of more help.

    Cheers
    Mark

  8. 6 Posted by Shyam on 28 May, 2018 04:37 AM

    Shyam's Avatar

    Hi Mark,

    Thank you for the reply.
    I have solved error for 'Microsoft.Office.Interop.PowerPoint.dll' contains invalid characters. However, I am not able to solve this 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Vbe.Interop\15.0.0.0__71e9bce111e9429c\Microsoft.Vbe.Interop.dll' contains invalid characters. error.

    Can you please help me on this?

    Regards,
    Shyam

  9. Support Staff 7 Posted by Mark Siedle on 28 May, 2018 04:51 AM

    Mark Siedle's Avatar

    Hi Shyam,

    We believe one of your dependencies is referencing an assembly (Microsoft.Vbe.Interop.dll) that's in the GAC (either directly or indirectly), and that is not something that NuGet.exe is able to access while packing. You will need to track this issue down in your project. Your developers would be best suited to help you track this down. Octopack is simply using NuGet.exe's pack command to package your project, so you should be able to reproduce this yourself on your development machine and take the investigation from there.

    Sorry we can't be of more help.

    Cheers
    Mark

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac