IgnoresAccessChecksToGenerator icon indicating copy to clipboard operation
IgnoresAccessChecksToGenerator copied to clipboard

Error "Could not load file or assembly ***" when I use it in console app (but it works in tests project)

Open Denis535 opened this issue 4 years ago • 2 comments

When I use it in nunit tests project then it works right. But when I use it in console project then I'm getting error: "Could not load file or assembly ***". What's wrong?

Denis535 avatar Nov 02 '20 21:11 Denis535

Hmmm, If I remove "***.deps.json" then it works.

Denis535 avatar Nov 03 '20 10:11 Denis535

I made test project with next target:

<Target Name="Tmp" AfterTargets="AfterResolveReferences">
    <ItemGroup>

        <ReferencePath Remove="C:\Users\Den\Desktop\ConsoleApp2\Lib\bin\Debug\netstandard2.0\Lib.dll" />
        
        <ReferencePath Include="C:\Users\Den\Desktop\ConsoleApp2\Lib\bin\Debug\netstandard2.0\Lib.dll">
            <CopyLocal>true</CopyLocal>
            <ReferenceSourceTarget>ProjectReference</ReferenceSourceTarget>
            <MSBuildSourceProjectFile>C:\Users\Den\Desktop\ConsoleApp2\Lib\Lib.csproj</MSBuildSourceProjectFile>
        </ReferencePath>

    </ItemGroup>
</Target>

It makes correct "***.deps.json". So, you should copy some metadata into new reference.

Denis535 avatar Nov 09 '20 11:11 Denis535

you should copy some metadata into new reference

This should be fixed in v0.7.0.

aelij avatar Dec 01 '23 09:12 aelij