# IT:AD:TeamCity:Nuget #
* [[../|(UP)]]
{{indexmenu>.#2|nsort tsort}}
## Installation ###
* Procedure:
* Find TeamCity Data directory
* C:\_System\TeamCity\.BuildServer\plugins\
* Stick downloaded zip there
* Stop TeamCity server
* Start TeamCity server
* You'll see a new tab on Server Administrator page
* Using NuGet Install option from behind Proxy failed.
* Instead:
* chose `Custom` and defined a path. That said space in `c:\Program Files\` caused it to fail. Worked when installed to `c:\Nuget\`. Might have worked as well if I chosen an %env....% defined path.
* Found this alternate Workaround mentioned on web: [http://bit.ly/tfQEHR](http://bit.ly/tfQEHR) that led to [http://bit.ly/sEvdSG](http://bit.ly/sEvdSG)
* Resources:
* http://blogs.jetbrains.com/dotnet/2011/08/native-nuget-support-in-teamcity/
* http://confluence.jetbrains.net/pages/viewpage.action?pageId=40702877
## Packaging ##
There are two ways of doing it:
* Getting TC to do a build of the *.sln first, and then invoke Nuget against a `*.nuspec` for a project within the solution.
* Getting TC to invoke Nuget directly against a `*.csproj` file, and it will build the project, then the `*.nupkg`.
* Using `*.nuspec`:
* `XAct.Core.nuspec` placed beside `XAct.Core.csproj`
* TeamCity settings:
* Specification file: `XAct.Core\XAct.Core\XAct.Core_Debug.nuspec`
* Base Directory= `XAct.Core\XAct.Core`
* Path = (Custom) `c:\Nuget\Nuget.exe`
* Pros:
* Works.
* Total control
* Cons:
* A lot of custom work in the *.nuspec
* Using *.csproj:
* As it is `nuget` that is running the build, and it's entry point is the *.csproj (`[CHECKOUTDIR]\XAct.Core\XAct.Core\XAct.Core.csproj`), it artificially sets the SolutionDir to the folder above it (eg: `[CHECKOUTDIR]\XAct.Core\`).
* As the SolutionDir is used by the *.csproj to import the Nuget.target file (``), it is never found (one dir to deep):
'...The imported project "...\work\f5a3a0936d0bc94c\xact.core\.nuget\NuGet.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.`"
* Tried:
* Setting CommandLine to `/Property:SolutionDir=` didn't work (the COmmand Line is for the NuGet -- not the MSBuild?)
* Benefits:
* Once working, it would be automated.
* Cons:
* Couldn't get it to work without a hack: had to put the .nuget directory in the the XAct.Core directory otherwise never found it.
* Much more difficult to get right.
* [http://bit.ly/sFBEk2](http://bit.ly/sFBEk2) and[http://bit.ly/rAXjKX](http://bit.ly/rAXjKX)