0

I have this CSProj on one computer that works. In that is a project reference:

  <Import Project="..\packages\SolidEdge.Community.AddIn.219.0.0\build\net40\SolidEdge.Community.AddIn.targets" 
Condition="Exists('..\packages\SolidEdge.Community.AddIn.219.0.0\build\net40\SolidEdge.Community.AddIn.targets')" />

The package files exist at this location. Loaded into VS2022, this package shows up in the References folder of the project.

Now I copy this project to another computer. I also copy the packages directory. In this case, the above reference still exists in the project file. The stuff exists in the project directory. But loaded into VS2022, this reference does not show up. Also, the program fails to build because 'using' statements can't get to the (no-longer)-referenced namespace.

My goal is to figure out what else I can copy from the source computer to make the target computer also work.

(I am doing this manual copy rather than rely on Nuget because I've been experiencing reference hell using Nuget. See Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. Manifest definition does not match the assembly reference to understand that nightmare. )

Alan Baljeu
  • 2,383
  • 4
  • 25
  • 40
  • You're going to have to go down the rabbit hole of matching environments on the two machines. Same VS ver, same NuGet ver, clear caches on both machines, check NuGet.config at machine level, etc. etc. – Kit Jul 13 '22 at 13:31
  • 1
    What do the outputs of the restore/build process say? – Daniel Mann Jul 13 '22 at 13:33
  • I see a helpful message: error : The package Json.Net with version 1.0.33 could not be found in C:\Users\Owner\.nuget\packages\ Copying that folder over (and creating the Owner folder) fixed things. – Alan Baljeu Jul 13 '22 at 13:59
  • 1
    If you have a `packages.config` in your solution root, you need copy it too. – shingo Jul 13 '22 at 14:03
  • Yes, I have copied everything. And copied the nuget folder from my user workspace. And I have identical VS versions and Nuget Versions. And all build errors are resolved. And I am back to the Newtonsoft error. Why is it so hard to get a repeatable build from one machine to another? – Alan Baljeu Jul 13 '22 at 14:53

0 Answers0