TheSwamp

Code Red => .NET => Topic started by: jmaeding on October 14, 2009, 04:36:03 PM

Title: any way to switch out reference paths in VS?
Post by: jmaeding on October 14, 2009, 04:36:03 PM
I am continually taking sample projects from people and having to switch the acad dll references for my acad version.
Must I detach and re-attach every time?
I know you can hand edit the project file, but there must be an easier way.
I don't use source-safe or any management tool, just plain VS 2008.
Title: Re: any way to switch out reference paths in VS?
Post by: Kerry on October 15, 2009, 05:47:49 AM
Several ways ...

Firstly I'd make a habit of using ( Referencing ) the Managed DLL's from the ObjectARX SDK
.. located in the ..ObjectARX 20xx\inc-win32   or ..\ObjectARX 20xx\inc-win64 folders.

Once you have referenced them, they are saved under the 'RECENT tab in the AddReferences dialog ... takes about 5 seconds to change them.

Next option would be to open the xxx.csproj file in a text or XML editor
the file references will be found in the section
  <ItemGroup>
    <Reference Include="acdbmgd"> ....
       ...
       ..    
    </Reference>

Like So
  <ItemGroup>
    <Reference Include="acdbmgd">
      <Name>acdbmgd</Name>
      <Private>False</Private>
    </Reference>
    <Reference Include="acmgd">
      <Name>acmgd</Name>
      <Private>False</Private>
    </Reference>
  </ItemGroup>

or So

  <ItemGroup>
    <Reference Include="AcCui, Version=17.1.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\ACAD2008\AcCui.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="acdbmgd, Version=17.1.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\ACAD2008\acdbmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AcDx, Version=17.1.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\ACAD2008\AcDx.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="acmgd, Version=17.1.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\ACAD2008\acmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="acmgdinternal, Version=17.1.0.0, Culture=neutral, processorArchitecture=x86">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\ACAD2008\acmgdinternal.dll</HintPath>
      <Private>False</Private>
    </Reference>

or so

  <ItemGroup>
    <Reference Include="AcDbMgd, Version=18.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <Private>False</Private>
    </Reference>
    <Reference Include="AcMgd, Version=18.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <Private>False</Private>
    </Reference>

If you locate one of your own files that work well, simply save the partial section somewhere handy so you can cut and paste into the offending file.

Note : Referencing ALL possible files used will not cause any problems .. the compiler will only read the files it actually needs.


Another option would be to write a custom converter for the XML format *.csproj file. ... lots of conditionals
if the section includes "aDLLName" replace the complete section

.... but it hardly seems worth it when the first option is so speedy.


///kdub
Title: Re: any way to switch out reference paths in VS?
Post by: jmaeding on October 16, 2009, 01:30:03 PM
true, its not a big time waster, it just seems like the properties grid should let you edit the path and it would do the switch for you.  It felt like i was missing some vs feature.
Acad has the xref dialog, so why not microsoft?  :-)
Title: Re: any way to switch out reference paths in VS?
Post by: Glenn R on October 22, 2009, 05:27:54 AM
You could try adding the folders to the system PATH statement...