How to detect changes to projects for file references
-
I don't know about all of you, but I assume you've experienced the same frustrations as me when it comes to a Solution with multiple projects added to it. We have 'Project References' as opposed to 'File References' where possible for the following reasons: 1 - We need to be able to enter the referenced assemblies during debugging. 2 - When our .sln builds, we need to make sure we've got the latest and greatest changes from our referenced assemblies. Before I (or someone on my team) embarks down the road of finding a solution to our problem, I thought I'd ask if anyone else has a solution or ideas on how we might change our Project Refs to File Refs, and not lose the benefit of the two points described above. It shouldn't be too difficult to build an add-in (or external tool) that would build a .csproj file in debug mode, and copy the .dll and .pdb file into the appropriate location for my solution. This would allow us to step through the code, satisfying point 1 above. I guess my main struggle is how would I setup a pre-build script (or something) to figure out which file references are actually from projects I've got on my box, and then figure out if it needs to rebuild them, and them build them and copy the dll and pdb file over. Any thoughts or comments would be great! Paul Brower
-
I don't know about all of you, but I assume you've experienced the same frustrations as me when it comes to a Solution with multiple projects added to it. We have 'Project References' as opposed to 'File References' where possible for the following reasons: 1 - We need to be able to enter the referenced assemblies during debugging. 2 - When our .sln builds, we need to make sure we've got the latest and greatest changes from our referenced assemblies. Before I (or someone on my team) embarks down the road of finding a solution to our problem, I thought I'd ask if anyone else has a solution or ideas on how we might change our Project Refs to File Refs, and not lose the benefit of the two points described above. It shouldn't be too difficult to build an add-in (or external tool) that would build a .csproj file in debug mode, and copy the .dll and .pdb file into the appropriate location for my solution. This would allow us to step through the code, satisfying point 1 above. I guess my main struggle is how would I setup a pre-build script (or something) to figure out which file references are actually from projects I've got on my box, and then figure out if it needs to rebuild them, and them build them and copy the dll and pdb file over. Any thoughts or comments would be great! Paul Brower
Paul Brower wrote:
how we might change our Project Refs to File Refs, and not lose the benefit of the two points described above.
It's not currently possible.
Paul Brower wrote:
I guess my main struggle is how would I setup a pre-build script (or something) to figure out which file references are actually from projects I've got on my box, and then figure out if it needs to rebuild them, and them build them and copy the dll and pdb file over.
That's not generally how file references are used. If you think of the file reference as a complete third-party library, you only pick up a newer version when the consuming code is 100% ready to and it is a deliberate step. It sounds like you have some references that are "common library" type of things. Even in this case, I would treat them the same way and look at them as if they were third-party libraries. To do what you want you would need to build an external tool (or add-in).
Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[Forum Guidelines] [Articles] [Blog]