1

I created a solution with several .Net and UWP projects with VisualStudio 2019 and on some of them a reference to Windows.Foundation.UniversalApiContract was added by VisualStudio on project creation. Since I use for instance Windows.Storage.Stream I can not remove this references.

When I use the solution in the directory I created the solution, it is no problem. But when I check it out into another directory on my PC, this reference could no longer be satisfied. My working collegue can also not work on this solution.

Can anyone tell my how I can fix this problem? Did I missed something to check in? I am using the default .gitignore for VisualStudio from github.

Kind regards, Wolfgang

hobber
  • 21
  • 3
  • Was the entire solution (changed files + csproj data) pushed when changes were made which required the additional references? Additionally, they may want to try a hard pull to get the files if you are certain that you commited/pushed them. https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files – Shawn Ramirez Mar 15 '22 at 20:08

1 Answers1

1

I fixed the problem by converting HintPath of the reference in project file from relative path to an absolute path, which should be equal on most PCs

C:\Program Files (x86)\Windows Kits\10\References\10.0.19041.0\Windows.Foundation.UniversalApiContract\10.0.0.0\Windows.Foundation.UniversalApiContract.winmd

and is more reliable than

..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\References\10.0.19041.0\Windows.Foundation.UniversalApiContract\10.0.0.0\Windows.Foundation.UniversalApiContract.winmd

because this path depends not on location of solution directory.

hobber
  • 21
  • 3