Reputation: 333
I have a .NET application that depends on many projects/builds. We are using TeamCity as our continuous integration server. I successfully set up the order of builds, based on dependencies and got the application compiling at the end correctly. This was using Visual Studio 2010. We recently switched to 2012 and I made the mistake of trying to move the build from .NET 4.0 to .NET 4.5 at the same time that I switched the builds to use VS 2012. Everything still worked, but the customer couldn't use .NET 4.5 in his environment. Now I'm trying to still use VS 2012, but revert everything back to 4.0.
DLL 1 is successfully compiling and I'm creating a .NUPKG to be used by DLL2. I see the artifacts for DLL1 and they show that the .NUPKG is indeed .NET 4.0. But when I try to compile DLL2, it can't 'find' DLL 1. I look in my packages folder and what seems to have been installed was .NET version 4.5 of DLL1.
I have tried installing the dll directly, as a 'dependency', found it was being erased (went into bin/Release and I was doing a Clean/Build), fixed that, but the system still didn't seem to think it was the right version. I have tried using the NUGET installer, and the 4.5 version seems to be what I get. I have tried using 'restore of missing packages', set up from VS 2012, and I still get 4.5.
From the logs:
[install] NuGet command: C:\TeamCityBuildAgent\tools\NuGet.CommandLine.2.1.0.nupkg\tools\NuGet.exe install C:\TeamCityBuildAgent\work\52d92aca0070dc48\OurLibrary\packages.config -OutputDirectory C:\TeamCityBuildAgent\work\52d92aca0070dc48\packages -Source http://localhost/guestAuth/app/nuget/v1/FeedService.svc/
[install] Starting: C:\TeamCityBuildAgent\temp\agentTmp\custom_script2900382890103739900.cmd
[install] in directory: C:\TeamCityBuildAgent\work\52d92aca0070dc48\OurLibrary
[install] All packages listed in packages.config are already installed.
If I run this command and the package has been deleted, it is correctly reinstalled. But the version reinstalled is net45.
Yes, my package.config does require 4.0:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MyCompany.Metadata.Interfaces" version="1.0.0" targetFramework="net40" />
</packages>
Suggestions??
Upvotes: 3
Views: 345
Reputation: 2233
If I understood the problem correctly, can you try running update-package -reinstall -Source http://localhost/guestAuth/app/nuget/v1/FeedService.svc/
from the package manager console and see if it's updated correctly?
Upvotes: 1