.NET Framework Bookmark and Share   
 index > MSBuild > Circular Reference with Project References
 

Circular Reference with Project References

Hi, we have several hundred project files that we're trying to assimilate into a build process. Thus far, we've had to leave a couple best practices behind because of circular references (quite a few, and on occasion 5+ dependencies down); in essence, dictating in the build file a fairly specific build order. One of my larger problems is that there are project references throughout some of the projects and MSBuild naturally wants to build that dependency, however, we know that the dependency is circular, therefore we include the binary in a referenced folder (indicated to MSBuild in the AssemblySearchPaths element), and we do not want that dependency built at that time, we want it to use the old version... if it can. So, my question is two fold, A) should I invest the time to programmatically change project references to assembly references before each build and across all files and/or is there an alternative and B) if you were in this situation and fixing the circular references was not an option (at least for the time being it is not for us) is there a different route (best practice) you would consider.

Thanks
Zeb
Zebedatious
Hi Zeb,

"programmatically change project references to assembly references"

I'm afraid that's the only way if you don't want MSBuild to build the dependencies. To handle this circular reference problem,both of your 2 workarounds are exactly the ways I know, MSBuild has no special key for it.

Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Wesley Yao
Hi Zeb,

"programmatically change project references to assembly references"

I'm afraid that's the only way if you don't want MSBuild to build the dependencies. To handle this circular reference problem,both of your 2 workarounds are exactly the ways I know, MSBuild has no special key for it.

Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Wesley Yao
Cool. Thanks. Wouldn't necessarily wanta built in workaround.

Thanks Wesley
Zeb
Zebedatious

You can use google to search for other answers

Custom Search

More Threads

• Project Dependencies/Build Order not working on a vm
• Building all configurations and all platforms
• MSBuild Community Tasks "File Not Found"
• Difference between the Properies Metadata and the AdditionalProperties Metadata ?
• exec task - space in the file path and name on command line
• Microsoft..TeamFoundation.Build.Targets and Continuous Integration Build
• MSBuild beginner questions
• Sharing defines between msbuild scipts
• How to use FxCop to break the build ?
• New to MSBuild