Closed filzrev closed 5 months ago
Currently NetPad creates different assembly name each time a query is executed.
assembly name
Test query
Assembly.GetExecutingAssembly().FullName.Dump(); Assembly.GetExecutingAssembly().CodeBase.Dump();
Output
`NetPad_CompiledAssembly_Script 1_b2b3d5aa-ffb7-4a2e-b122-55f0add3514a, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null `file:///C:/Users/admin/AppData/Local/Temp/NetPad/Processes/371cbddd-91b1-4c40-9943-70abbe1f6d60/Script_1.dll`
If it can use fixed assembly name (e.g. NetPadQuery) It can access internal types of external DLLs. (If external DLL using InternalsVisibleToAttribute).
NetPadQuery
InternalsVisibleToAttribute
LINQPad supports this feature with [InternalsVisibleTo("LINQPadQuery")]
[InternalsVisibleTo("LINQPadQuery")]
Sure, good idea. Will go out with next release!
PR merged. Similar to LINQPad, you'll be able to use:
[InternalsVisibleTo("NetPadScript")]
Currently NetPad creates different
assembly name
each time a query is executed.Test query
Output
If it can use fixed assembly name (e.g.
NetPadQuery
) It can access internal types of external DLLs. (If external DLL usingInternalsVisibleToAttribute
).LINQPad supports this feature with
[InternalsVisibleTo("LINQPadQuery")]