OctoPack w/Class Library project?

Is it possible to use OctoPack/Octopus with a Class Library project (not an console or web app)? I’m trying to create a project based on NServiceBus, which requires the project to be a Class Library, with NServiceBus.Host.exe included as a reference. When I add OctoPack to the Class Library and add a nuspec file and build, no nuget package is created.

Hi Rob,

It should be possible. Are you building in Release mode? Could you share the build output?

Paul

Yes to release mode (I also tried Debug with OcotpusPackageConfiguration=Debug).

The class library project name is Grasshopper.Notifications.BlankCommandEndpoint.csproj. The nuspec file is Grasshopper.Notifications.BlankCommandEndpoint.nuspec.

Build output…

------ Build started: Project: Grasshopper.Notifications.Legacy, Configuration: Release Any CPU ------
Grasshopper.Notifications.Legacy -> C:\dev\VPS\Notifications\Grasshopper.Notifications.Legacy\bin\Release\Grasshopper.Notifications.Legacy.dll
------ Build started: Project: Grasshopper.Notifications.Messages, Configuration: Release Any CPU ------
Grasshopper.Notifications.Messages -> C:\dev\VPS\Notifications\Grasshopper.Notifications.Messages\bin\Release\Grasshopper.Notifications.Messages.dll
------ Build started: Project: Grasshopper.Framework.Logging, Configuration: Release Any CPU ------
Grasshopper.Framework.Logging -> C:\dev\VPS\Framework\Grasshopper.Framework.Logging\bin\Release\Grasshopper.Framework.Logging.dll
------ Build started: Project: Grasshopper.Notifications.Domain, Configuration: Release Any CPU ------
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “C:\dev\VPS\Notifications\Grasshopper.Notifications.Legacy\bin\Release\Grasshopper.Notifications.Legacy.dll”, “x86”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Grasshopper.Notifications.Domain -> C:\dev\VPS\Notifications\Grasshopper.Notifications.Domain\bin\Release\Grasshopper.Notifications.Domain.dll
------ Build started: Project: Grasshopper.Notifications.Infrastructure, Configuration: Release Any CPU ------
Grasshopper.Notifications.Infrastructure -> C:\dev\VPS\Notifications\Grasshopper.Notifications.Infrastructure\bin\Release\Grasshopper.Notifications.Infrastructure.dll
------ Build started: Project: Grasshopper.Notifications.MessageHandlers, Configuration: Release Any CPU ------
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “C:\dev\VPS\Notifications\Grasshopper.Notifications.Legacy\bin\Release\Grasshopper.Notifications.Legacy.dll”, “x86”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Grasshopper.Notifications.MessageHandlers -> C:\dev\VPS\Notifications\Grasshopper.Notifications.MessageHandlers\bin\Release\Grasshopper.Notifications.MessageHandlers.dll
------ Build started: Project: Grasshopper.Notifications.BlankCommandEndpoint, Configuration: Release Any CPU ------
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly “WebActivator”. Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “C:\dev\VPS\Notifications\Grasshopper.Notifications.Legacy\bin\Release\Grasshopper.Notifications.Legacy.dll”, “x86”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “NServiceBus.Host32, Version=3.2.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c, processorArchitecture=x86”, “x86”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Grasshopper.Notifications.BlankCommandEndpoint -> C:\dev\VPS\Notifications\Endpoints\Grasshopper.Notifications.BlankCommandEndpoint\bin\Release\Grasshopper.Notifications.BlankCommandEndpoint.dll
========== Build: 7 succeeded or up-to-date, 0 failed, 0 skipped ==========

It looks like when I added the OctoPack nuget reference, it didn’t add the OctoPack target to my csproj file.

The Import was missing in the csproj file. I tried adding OctoPack to three different projects, and the Import wasn’t added to any of them. When I manually added the Import, the package was built fine.

Thanks Rob, that seems to have happened to a few people. What version of VS are you using? I wonder if something has broken the code that adds the imports.

Paul

It’s VS2010 Ultimate, using Nuget 2.0.30625.9003 (the latest as of today)

It looks like adding OctoPack via Nuget is adding the import to Startup Project in the solution, not the project that I selected Add Reference to…