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();
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
http://www.linqpad.net/download.aspx#beta
It includes code to resolve .netstandard in third-party driver domains.
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.
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
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