Driver can't reflect on a .net standard 2 library

This seems like a reflection issue, but I'll post it here nevertheless.
While playing with LLBLGenPro 5.3 beta (supports .netstandard 2) I found that the driver has problems reflecting over .netstandard 2.0 assembly.
Specially the method assembly.GetExportedTypes() in AssemblyProbe.GetTypeNames method would throw

System.IO.FileNotFoundException: 'Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'

I tried reproducing it with a .net 4.6.2 console application and I see the same behavior.
The current workaround for my repro is to add the deprecated NETStandard.Library.NETFramework nuget package to the console.

Repro code

const string file = @[PATH]\ClassLibrary2.dll;
var assembly = Assembly.LoadFile(file);
var types = assembly.GetExportedTypes();

Comments

  • Try the latest beta:
    http://www.linqpad.net/download.aspx#beta

    It includes code to resolve .netstandard in third-party driver domains.
  • Hi Joe,

    It throws the same error. Can you try this approach instead?

    Answer from github..

    Just add

    <PropertyGroup>
     <DependsOnNETStandard>true</DependsOnNETStandard>
    </PropertyGroup>

    to LINQPad.csproj and it might work.
  • edited December 2017
    And where is it in the LINQPad.csproj file?

    I found, but how do I solve this error?

    ---------------------------
    Cannot load assembly: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
    ---------------------------
    Thanks,
    Homero
  • edited December 2017
    Hi, I'm facing this issue when trying to add EF Core 2.0 project. I've updated to the latest beta.
    After choosing my custom assembly I get:

    Cannot load assembly: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

    Please advise.
    Thanks,
    Shlomi
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!