Did anyone else had the problem that .pe and .pdbx files gets deleted on a rebuild/rebuild all in Visual Studio?
I have mutiple NETMF projects in one solution.
The output path of all projects is the same because one of my VS pluings requires this.
Lets say I have a dll A and B where A references B.
When I rebuild A, then B.pe and B.pdbx in le and be folder gets deleted.
By this I get an Deploy error which says “Check your hardware”.
I am the developer of the plugin, and we use it only internally.
So far it never made a Problem when building everything into the same Output Directory.
Only for NETMF Projects the pe and pdbx files get deleted of the solution internally referenced Projects on a rebuild (I assume the Cleanup is responsible for this).
If you have the Output Directory open in Explorer you nicely see how it is happening.
So for now I have to live with this.
And fore everyone else: do not share the Output Directory over severl prejects if you don’t have to ;o)
Do you really have to use the same output directory? Could you accomplish the same thing using post-build scripts to copy the files your plug-in needs from one directory to the other as needed rather than try and have VS work in a way it’s not intended?
That’s a nice idea.
It just has one disadvantage: I would have to set a special startup project if I’d like to start from the common dir. And I’m not sure if VSHost.exe would work there (for Win projects).
But I keep it in mind.
I don’t follow you? I assume you already have a startup project. All you have to do is add a post-build script that copies in the files you need from the other output directories into your startup output directory. You don’t need a separate output directory just to consolidate the files into. Perhaps I don’t understand enough about how your plugin works.
My plugin is more or less something like NuGet. It copies all referenced dll’s into the output directory, and it allows me to switch the referenced versions easily
But I can also create releases on our server.
Both is way easier if I have a common output dir.
If I copy all projects from individual build dirs to one in a script, then I need to set the startup file in the custom dir manually because teh default startup file is in the original output dir. And I’m not sure if I can use vshost.exe in any other dir that the original output dir.
Can you use a post build step to copy the files into the common directory? Generally a good idea to build into the default paths just to keep everything together.
On one of our most complicated projects we have an msbuild step that traverses our projects and packages everything we need into the one output artifacts directory. (also useful for the CI server to generate the install package)
It’s also a good way to track down obscure dependency failure bugs
If a project’s outputs are all in a project dir, it is easy to compare dll versions, etc between projects. Otherwise it’s a case of ‘last to build wins’ and those are not fun bugs to find…
Because of my little plugin I have nearly no dependecy problems.
All external dependencies are managed by my plugin which copies the the dll’s I need and raises an build error if I try to use incompatible dll versions which might occur because of dependencies from referenced dll’s.