title: Relative Referencing in Visual Studio 2013 (vb.net)
body: <p><strong>Problem:</strong> So, my issue is that I have 3 .dll files I want to include in my software. However, whenever I transfer the .exe to another computer, it looks for my hard coded absolute path in my computer. I want the dlls to be included or embedded such that I can distribute it to others.</p>
  
  <p><strong>Setup:</strong> </p>
  
  <p>I have done so by going to the solution explorer and doing Add->Exisiting Item, and add the three dlls into the solution explorer. </p>
  
  <p>Then I went to each .dll's properties and changed them so that they are considered embedded resources. Like so:</p>
  
  <p><img src="https://i.stack.imgur.com/LlSCZ.png" alt="Woo for visuals"></p>
  
  <p>Then I went to the references tab of the project property, and added a reference to the three dlls in my code. I originally had them in my /bin/ folder of my project, but I still had this problem. so I added them here in the same folder as my project. </p>
  
  <p><img src="https://i.stack.imgur.com/S3MZb.png" alt="enter image description here"></p>
  
  <p>Great, so I compile, copy to another computer, and get an exception (I threw it to a message box for ease) saying it can't find the dll and/or its dependencies. I even put a copy of the dll in the same .exe folder on the separate computer, but the same problem. </p>
  
  <p><strong>What I've Tried:</strong> So I tried messing around with the project file. But it looked ok to me. Here's a snippet: </p>
  
  <pre><code> &lt;ItemGroup&gt;
  &lt;Reference Include="PcapDotNet.Base, Version=0.10.0.20588, Culture=neutral, PublicKeyToken=4b6f3e583145a652, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;.\PcapDotNet.Base.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="PcapDotNet.Core, Version=0.10.0.20632, Culture=neutral, PublicKeyToken=4b6f3e583145a652, processorArchitecture=x86"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;.\PcapDotNet.Core.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="PcapDotNet.Packets, Version=0.10.0.20603, Culture=neutral, PublicKeyToken=4b6f3e583145a652, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;.\PcapDotNet.Packets.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System" /&gt;
  &lt;Reference Include="System.Data" /&gt;
  &lt;Reference Include="System.Drawing" /&gt;
  &lt;Reference Include="System.Windows.Forms" /&gt;
  &lt;Reference Include="System.Xml" /&gt;
  &lt;Reference Include="System.Core" /&gt;
  &lt;Reference Include="System.Xml.Linq" /&gt;
  </code></pre>
  
  <p>
  and later ...</p>
  
  <pre><code> &lt;ItemGroup&gt;
  &lt;EmbeddedResource Include="PcapDotNet.Base.dll" /&gt;
  &lt;EmbeddedResource Include="PcapDotNet.Core.dll" /&gt;
  &lt;EmbeddedResource Include="PcapDotNet.Packets.dll" /&gt;
   &lt;/ItemGroup&gt;
  </code></pre>
  
  <p><strong>Question:</strong> So, why is it saying it can't find the dll? Where could it still be looking for it in the wrong place?</p>
  
  <p>Thanks everyone!</p>