VS.NET and hintpath problems...

In a project we are working with multiple developers AND a build server on a large set of Visual Studio solutions. Problem is that when we have references to a folder with shared assemblies, the relative path to those assemblies specified by a hintpath directive in the .csproj file ends up wrong. The solution file opens up on one system. but fails on another system (reference not found). We also have problems in our automated builds (using the NAnt solution task).

A fix to this is setting a registry entry to the folders with shared assemblies, if the assembly can't be found, this path is checked.

Add a key with any name to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders, and set its (Default) value of type REG_SZ to the path with your assemblies.

5 Comments

  • Yet annother application of VisualStudio\7.1\AssemblyFolders





    Thanks.

  • Great Serge,

    Just what we needed for our BizTalk Cruisecontrol build machine.

    Thanks

  • The easiest solution is to modify the .csproj file in a text editor and change the value of the tag to be static instead of relative. Visual Studio will not modify the path when the project is reloaded and you will no longer have the problem.

  • Thanks Serge,
    Exactly what we needed to solve assembly referencing problems on a dedicated system that carrys out automated builds

  • Resolving Assembly References at Build Time

    At build time, Visual Studio .NET resolves assembly references by searching the following

    locations in the following order:

    1. Look for the assembly in one of the project folders. This assumes that you have added the

    assembly to the project by using the Add Existing Item menu option. Project folders include any

    folder displayed by Solution Explorer (except when Show All Files is in effect).
    2. Look in the folders listed in the ReferencePath attribute of the element within

    the project user options file. This attribute can contain a comma delimited list of folders.
    3. Use the element in the project file.
    4. Look in a set of folders identified by registry settings. These are the ones that contain

    assemblies displayed on the .NET tab of the Add references dialog box. For more details, see

    Using the .NET Tab of the Add Reference Dialog Box.
    5. Look for COM Interop assemblies in the obj sub folder beneath the project folder. For more

    details, see Referencing COM Objects.

    Notice that the reference path in the project user options file takes precedence over the hint

    path established when you set a file reference.

Comments have been disabled for this content.