Norpix

In short : How can I make Visual Studio ignore the result of the "Registering output" step while building a project. (i.e. not
stopping if the registering fails because of missing dependencies)

In long : We have about 100 projects in a workspace. Each of these project is ATL/COM DLL that use a different 3rd party API.
When we rebuild all those projects, we have all the 3rd party .h and .lib needed to build each project. However, we don't have all the DLLs that will be dependencies of each projects. That is ok as we don't want to install the 100 seperate API on each development machine here.

Now, each programmer work on a set of projects and may or may not have each 3rd party DLL installed in his machine. In each project, we checked the "Register Output" option in the linker settings so that COM DLL will register (provided the dependencies are installed). However, we also have a couple of "Custom Build" steps that need to be done regardless of whether the registration succeeded of failed.

Is there a way to ignore the result of the "registering output" step so that we get to the "Custom Build" part everytime

Our current "solution" involve doing 2 successive builds. The post-build part will be done on the second build because the project is considered up-to-date and don't retry to register the dll.

I hope there is a better way to do it !

Thanks a lot !



Re: Visual C++ General Making the build ignore "Registering Output" result

Bruno van Dooren

The easiest solution would be to not use 'register output' but to have a batch file that registers the output as a post build step.

That way the post build step tries to register all output, but if a registration fails that won't affect your build process.

Of course, you may have to prevent batch file errors from returning to VStudio, but at least you can do that. My batch file knowledge is very limited so I cannot help you there, but this is the only way I can see to solve your problem





Re: Visual C++ General Making the build ignore "Registering Output" result

Norpix

Thanks for the suggestion.

However, I was hoping to find a solution along the lines of this : http://blogs.msdn.com/astebner/archive/2006/08/08/691849.aspx

If I knew where the registering is done, I could force a return value of "true"...

For now, the best I could come up with is to set the Register Output to false, then at the end of our custom build step's command line, add :

regsvr32 /s $(TargetPath)
goto VCEnd

The goto will skip the autogenerated part of the batch file that look for errorlevel.