1
votes

Not long ago I decided to start using Nuget for managing 3rd party libraries. However, since I started using Nuget, Teamcity was no longer able to build the solution.

So, I have a WindowsPhone project where I use a t4 template for the configuration file. I followed Oleg Sych's instruction for integrating MSBuild and T4. This project was building just fine on my TeamCity build server. Well, fine until I started using Nuget. Added some packages and set RestorePackaged to true, after that I no longer was able to build the solution in TeamCity.

The error I get in TeamCity is the following:

C:\Program Files\MSBuild\Microsoft\VisualStudio\TextTemplating\v10.0\Microsoft.TextTemplating.targets(396, 5):
Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration. Line=1, Column=1 
C:\Program Files\MSBuild\Microsoft\VisualStudio\TextTemplating\v10.0\Microsoft.TextTemplating.targets(396, 5): 
Compiling transformation: Method must have a return type. Line=1, Column=6 
C:\Program Files\MSBuild\Microsoft\VisualStudio\TextTemplating\v10.0\Microsoft.TextTemplating.targets(396, 5): 
Compiling transformation: Type expected. Line=1, Column=12

The output file for the T4 templates contains the following message: ErrorGeneratingOutput

On my local machine using VS2010 the solution also fails to build. However, the problem is that MSBuild does process the T4 template and generates an output file, but it does not add it to the project file. So, build fails because it cannot find the specific class.

Did anyone experience a similar issue? Are there any fixes? Or can somebody tell me where should I look for a fix?

I would really appreciate any help on fixing this issue.

Thank you!

1
Does package restore function download packages correctly? Any errors from nuget in output?Pavel Bakshy
Yes, the restore functionality works fine. Nuget outputs no errors.Mike

1 Answers

2
votes

Ok, I found the solution!

My mistake was to install Nuget on the build server. Once I remove the nuget vsix extension everything started working.

Also, I noticed that by default Nuget looks for the config file at: "%APPDATA%/NuGet/NuGet.Config" and there is no way to override it, at least I haven't found one. Although this link http://nuget.codeplex.com/workitem/1358 states that Nuget will use the local file from .nuget folder if it exists.