Access Denied on using DSOFile.dll reference at VisualStudio 2022 running as standard user

Sven Kuehne 40 Reputation points
2023-06-08T09:30:42.7866667+00:00

After Upgrade from Win10 -> Win11 I can no longer build my solution under standard user.

If I run VS as admin everything works.

One project has an reference to the DSOFile.dll User's image

Switching "Embed Interop Types" to false, still brings up that error.

I got following error:

6>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2927,5): warning MSB3290: Failed to create the wrapper assembly for type library "DSOFile". Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I checked access to output and folders (bin, Debug, obj, C:\TempX). With no success.

Has anybody an idea how to fix it?

Additionally is here the diagnostic output, but with no further hints:

 Creating new cache file at "obj\Debug\HelperClasses.csproj.ResolveComReference.cache". (TaskId:83)
3>  Resolving COM reference for item "DSOFile" with a wrapper "tlbimp". (TaskId:83)
3>  Determining dependencies of the COM reference "DSOFile". (TaskId:83)
3>  Resolving COM reference dependency "00020430-0000-0000-c000-000000000046" version 2.0. (TaskId:83)
3>  Resolved COM reference dependency "00020430-0000-0000-c000-000000000046" version 2.0: "C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll" (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type 'dsoFilePropertyType' imported. (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type 'dsoFileOpenOptions' imported. (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type 'CustomProperty' imported. (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type 'CustomProperties' imported. (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type 'SummaryProperties' imported. (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type '_OleDocumentProperties' imported. (TaskId:83)
3>  Processing COM reference "DSOFile" from path "C:\TempX\dsofile.dll". Type 'OleDocumentProperties' imported. (TaskId:83)
3>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2927,5): warning MSB3290: Failed to create the wrapper assembly for type library "DSOFile". Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
3>Done executing task "ResolveComReference". (TaskId:83)

And Here is the part of Microsoft.Common.CurrentVersion.targets where the Error reference to:

Pos(2927,5) points to "<ResolveComReference"

</ResolveComReferenceMSBuildArchitecture>

      <ResolveComReferenceToolPath Condition="'$(ResolveComReferenceToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</ResolveComReferenceToolPath>
      <ResolveComReferenceSilent Condition="'$(ResolveComReferenceSilent)' == ''">false</ResolveComReferenceSilent>
    </PropertyGroup>

    <ResolveComReference
          TypeLibNames="@(COMReference)"
          TypeLibFiles="@(COMFileReference)"
          ResolvedAssemblyReferences="@(ReferencePath)"
          WrapperOutputDirectory="$(InteropOutputPath)"
          IncludeVersionInInteropName="$(IncludeVersionInInteropName)"
          KeyContainer="$(KeyContainerName)"
          KeyFile="$(KeyOriginatorFile)"
          DelaySign="$(DelaySign)"
          StateFile="@(_ResolveComReferenceCache)"
          TargetFrameworkVersion="$(TargetFrameworkVersion)"
          TargetProcessorArchitecture="$(ProcessorArchitecture)"
          NoClassMembers="$(ComReferenceNoClassMembers)"
          Silent="$(ResolveComReferenceSilent)"
          EnvironmentVariables="$(ResolveComReferenceEnvironment)"
          SdkToolsPath="$(ResolveComReferenceToolPath)"
          ExecuteAsTool="$(ComReferenceExecuteAsTool)"
          MSBuildArchitecture="$(ResolveComReferenceMSBuildArchitecture)"
          ContinueOnError="$(ContinueOnError)">

      <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
      <Output TaskParameter="ResolvedFiles" ItemName="ComReferenceWrappers"/>
      <Output TaskParameter="ResolvedFiles" ItemName="FileWrites"/>
      <!-- This output list only includes items with Isolated attribute set to True.  It's done by the task itself. -->
      <Output TaskParameter="ResolvedModules" ItemName="ResolvedIsolatedComModules"/>

    </ResolveComReference>

    <ItemGroup>
      <FileWrites Include="@(_ResolveComReferenceCache)"/>
      <ReferenceComWrappersToCopyLocal Include="@(ComReferenceWrappers)" Condition="'%(ComReferenceWrappers.CopyLocal)'!='false'"/>
    </ItemGroup>

  </Target>

  <Target
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | Visual Studio | Other
Community Center | Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,446 Reputation points Microsoft External Staff
    2023-06-09T07:05:15.23+00:00

    Hello @Sven Kuehne ,

    Welcome to Microsoft Q&A forum.

    If you assign the permissions to DSOFile.dll file, will the issue disappear?

    Right-click the DSOFile.dll file > select Properties > switch to Security tab > click Edit… > choose the corresponding user > check the options under "Allow" and click Apply.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.