microsoft / microsoft/psi

Could not load file or assembly 'Microsoft.Psi.Media_Interop.Windows.x64, Version=0.18.72.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

Open
#298 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
574
Forks
104
Avg merge
19m
Merged PRs (30d)
1

Description

When I try to run my project, I get the following error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Psi.Media_Interop.Windows.x64, Version=0.18.72.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 

Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Psi.Media_Interop.Windows.x64, Version=0.18.72.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 

Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019) ---> System.IO.FileLoadException: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x80131019)

The workaround I've found is to include the following in my .csproj file:

    <Content Include="$(NuGetPackageRoot)/microsoft.psi.media.windows.x64/0.18.72.1-beta/lib/net472/Microsoft.Psi.Media_Interop.Windows.x64.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>

Adding the following didn't work:

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

When I use dotnet run to run my project, it fails with the same error the first time, and it starts working again the second time. I'm assuming dotnet run somehow copies the dll over on the first run. Not sure why it fails every time on Visual Studio without the workaround above.

Any pointers would be appreciated!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the project’s .csproj and the Microsoft.Psi.Media_Interop.Windows.x64.dll from the NuGet package path shown in the report. Reproduce the failure with Visual Studio and the first and second dotnet run attempts, then compare output files and copy behavior. Done means the dependency loads consistently without the manual Content entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.