Search code examples
dllvisual-studio-2017visual-studio-2022

Upgrading to VS 2022 some DLL references show yellow exclamation mark


My .NET solution is building perfectly in VS2017 (x86) running on Windows 10 targeting .NET framework 4.6.1

I'm trying to install VS2022 (x64) on a Windows 11 machine and build the solution but it fails because it can't resolve references to some DLL's. The DLL's are a mix of windows DLL's and some third party programs which are all installed on the new Window 11 machine (e.g. iTunes and UPNP). I've tried removing the reference to those DLL's and readding them (VS2022 can see them and add the to the project) but it still shows a yellow exclamation mark after adding them.

The only differences I've noted between the 2 machines are:

Original Machine

  • Windows 10
  • VS 2017 (x86)
  • Target .NET Framework 4.6.1

New Machine

  • Windows 11
  • VS 2022 (x64)
  • Target .NET Framework 4.8

Here's one such windows UPNPLib DLL (upnp.dll) that shows up as a yellow exclamation mark on the new build machine.

<ItemGroup>
    <COMReference Include="UPNPLib">
      <Guid>{DB3442A7-A2E9-4A59-9CB5-F5C1A5D901E5}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
  </ItemGroup>

enter image description here

Anyone have any ideas why VS 2022 is having trouble with these DLL's?


Solution

  • For future reference, I was able to resolve this issue by starting Visual Studio with Administrative rights. Now it was able to "access" those DLL's in the references without any issues. I didn't make any other changes.

    I don't know why it needs Administrative rights to access some DLL references. This isn't listed as one of the reason why VS needs to have administrative right on this page:

    https://learn.microsoft.com/en-us/visualstudio/ide/user-permissions-and-visual-studio?view=vs-2022

    or here

    https://learn.microsoft.com/en-us/visualstudio/ide/troubleshooting-broken-references?view=vs-2022

    Maybe someone who know the reason can update this answer to include that information.