OctoPack not including files in the GAC


As background I’ve got a bunch of builds that use Octopack via FAKE. It’s a pretty typical setup with a FAKE target as follows;

Target "BuildSolution" (fun _ ->
    let setParams defaults =
        { defaults with
            Verbosity = Some(Quiet)
            Targets = ["Build"]
            Properties =
                    "Optimize", "True"
                    "DebugSymbols", "True"
                    "Configuration", buildMode
                    "RunOctoPack", "true"
                    "OctoPackPackageVersion", buildVersion
                    "OctoPackPublishPackageToFileShare", artifactsDir
                    "OctoPackNuGetExePath", nuGetPath
                    "OctoPackAppendToPackageId", octoPackAppendToPackageIdValue

    build setParams solutionFile
      |> DoNothing

One particular build is currently causing issues by excluding System.Net.Http.Formatting.dll from the nupkg file. Running the build script locally doesn’t have this problem however the TeamCity build agents appears to have System.Net.Http.Formatting installed in the GAC. The build agent runs windows server 2008 RC2 I believe at a point in time this was delivered as part of windows.

Firstly is it the fact System.Net.Http.Formatting is found in the GAC that causes it to be excluded from the nupkg file?

Secondly if so whats the workaround?

I tried to use OctoPackEnforceAddingFiles with a nuspec file as defined below but this didn’t seem to resolve the issue;

    <file src="../build/System.Net.Http.Formatting.dll" />

Any suggestions or help would be great. Not sure if I’m going in the wrong direction here.

Hi Tim,

Thanks for reaching out!

OctoPack just packages what is found in the bin folder of the application, so, as you surmised, if it’s in the GAC, it wont be pulled in.

If you change the ‘CopyLocal’ setting on the reference in the project file to ‘true’, it will copy it into the bin folder and then into the nuget package.

Hope that helps!


PS - I hadn’t played with FAKE before - thanks for the opportunity to do so :slight_smile:

Your right this wasn’t anything to do with the GAC but some less than helpful setup with our internal packages.

Locally MSBuild was using a copy of the dll from another product stored on my c drive. You could see from the build log it copying it from that location to the bin. On our build agent this wasn’t possible so the dll was excluded.

Thanks for he insight into OctoPack it helped me look past that and into the detail of the MSBuild command.


This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.