aelij / IgnoresAccessChecksToGenerator

Generates reference assemblies where all the internal types & members become public, and applies the IgnoresAccessChecksTo attribute
MIT License
167 stars 21 forks source link

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

Closed Denis535 closed 10 months ago

Denis535 commented 3 years ago

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 commented 3 years ago

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

Denis535 commented 3 years ago

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.

aelij commented 10 months ago

you should copy some metadata into new reference

This should be fixed in v0.7.0.