Oly
Oly

Reputation: 2469

Can I reference a .NET executable as if it is a DLL in LINQPad 6?

In LINQPad, I can add a reference to a local .NET dll file using Query Properties > Additional References > Add / Browse.

Then I can import namespaces and access members defined in the dll in my LINQPad script.

I can also add a reference to a local .NET exe file in the same way, just as I might do for a normal .NET project. The exe in question was compiled as a net472 target.

When I try to access members defined in the exe file, I get this error

The type or namespace name '...' could not be found

Is there a way to import and use members defined in a .NET project which was compiled to an exe in this way?

(I'm using LINQPad 6)

Upvotes: 2

Views: 949

Answers (1)

Joe Albahari
Joe Albahari

Reputation: 30934

This is a good question: LINQPad 6 lets you reference .NET Framework assemblies if they happen to be compatible with .NET Core.

However, right now it doesn't recognize files with a .exe extension as potential .NET assemblies, and instead copies them to the output directory rather attempting to reference them. I'll look into whether this is easy to fix for the next build.

Upvotes: 1

Related Questions