Safe import of .target files

We’ve changed most of our projects to import other .target files. This means that we get allot of warnings about unsafe imports.

To eliminate these we can add a registry setting with the file name of the .targets file in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\MSBuild\SafeImports.

However this needs to be the full path of the file, which makes it problematic for branching and for teams without common rules of where to put their work spaces.

Our initial idea was to create an .inf file that adds our project targets to the registry, but the full-path requirement spoils it for us as we use allot of branches.

For more information I found this how-to.

Along with this Forum entry in 2005, describing that this has been reported as a bug.