[SOLVED] Octopack tries to package Class library which is a reference from a Console & WIndows Service project

The subject may not be totally clear.

What I have is 2 projects to octopack…a Console and Windows Service. I added the OctoPack nuget package to each project, added the nuspec file named after the project. I also added the Import targets into the .csproj files as that did not happen as part of the nuget package install.

When I flip to Release mode and build, Octopack is trying to run against one of the referenced class libraries that is referenced by another project the Console and Windows Service packages reference. This breaks the build as Octopack is expected a nuspec file for this class library. If I add it, everything is fine, but if not, the the build does not work.

Why would Octopack try and run against this class library project when I have not installed Octopack nuget into this DLL project?


I found the issue. Apparently, the Import for the .csproj file was created in the class library project vs. the two I installed OctoPack into using NuGet. I removed:

Import Project="$(SolutionDir).octopack\OctoPack.targets"

…from the class library and properly added it to both the Console and Windows Service .csproj file and everything is fine now!

I am assuming this happened because the class library was the startup project in the solution when OctoPack was first added to the Console project.

Thanks for the update Jesse, glad you found the problem. I’ll look into what’s going on with the .targets files.

Paul

I’ve seen this behavior also. I think that it might have to do with which project is set as the startup project in the solution. It’s very annoying though. Not only does the build break for the class library, but I have to edit each csproj file by hand.