开发者

Configure TeamCity to follow OutputPath directives in csproj files

开发者 https://www.devze.com 2023-01-08 18:40 出处:网络
I\'m setting up TeamCity to build some solutions whose projects have an OutputPath directive that redirects the build to ../../bin/Release or ../../bin/Debug. The solutions obviously build fine in Vis

I'm setting up TeamCity to build some solutions whose projects have an OutputPath directive that redirects the build to ../../bin/Release or ../../bin/Debug. The solutions obviously build fine in Visual Studio 2008 but when TeamCity builds the solutions it fails to find the assemblies of referenced projects and we get namespace errors (The type or namespace name 'SomeReferencedAssembly' does n开发者_如何学JAVAot exist in the namespace 'AssemblyBeingBuilt').

Is there a way to tell TeamCity where to look for referenced projects whose assemblies are not in the default location? It does understand the directive because when it builds the referenced project, the output is directed correctly. Its just that other projects it builds afterwards are not finding the assemblies they depend on.


Are the unfound references 3rd party (code you don't compile), or your code?

If third party, then you want to make sure that the source control repository root you are pointing at at results in dependencies also being checked out. (or worse, putting them in GAC or installing them on each build server, not a good idea unless you have to)

If your code, are they build by a project in the same solution or a different one?

To the degree you can make one project dependent on another and then point the build at a solution, this is a good thing.

If 2 different solutions, then you have to use the Dependencies (section 5) to set up an Artifact dependencies.


Are you using the solution runner in teamcity? If so then the location of the references is specified in each csproj. You shouldn't need to do any additional configuration.

Verify that the references are project references rather than assembly references. An assembly reference may point to ../../bin/debug/assembly.dll which would not resolve when compiling in release.

You can look in the csproj to confirm, alternatively visual studio will only show the 'Specific version' dropdown in Properties for assembly references.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号