visual-studioreferencevcproj

Why Visual Studio removes the drive letter from the AssemblyReference RelativePath when editing a project?


using visual studio we always load and build references to a unit (R:). The problem is that when someone edits any project properties the drive letter is removed from the assembly path and then the build machine can not build the application.

The project file looks like this when created:

<References>
    <AssemblyReference
    RelativePath="R:\ClientContext.dll"
    AssemblyName="ClientContext, Version=8.3.0.0, PublicKeyToken=255e4d2a8e3ef422, processorArchitecture=MSIL"
    MinFrameworkVersion="131072"
    />

And after editing any property:

<References>
    <AssemblyReference
    RelativePath="ClientContext.dll"
    AssemblyName="ClientContext, Version=8.3.0.0, PublicKeyToken=255e4d2a8e3ef422, processorArchitecture=MSIL"
    MinFrameworkVersion="131072"
    />

The project files are vcproj, notsure if this happens in other formats too.

Thanks in advance mates.


Solution

  • This page may give you some insight, particularly important is the comment about the "RelativePath" setting: "Relative Path - Displays the relative path from the project directory to the referenced assembly." http://msdn.microsoft.com/en-us/library/47w1hdab.aspx

    The issue is that it is always going to reset it to be relative to the project.