LinqPad access to internals of signed assemblies

1k views Asked by At

Is there a signed version of LinqPad that I could use in order to access internals of signed assemblies?

2

There are 2 answers

1
sixdiamants On

Extra information for those puzzled how to insert assembly attributes into AssemblyInfo.cs; Visual Studio (tested 2022) generates MyProject.AssemblyInfo.cs from your MyProject.csproj file.

Add this to your MyProject.csproj:

<ItemGroup>
  <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
     <_Parameter1>LINQPadQuery</_Parameter1>
  </AssemblyAttribute>
</ItemGroup>

After a rebuild, the MyProject.AssemblyInfo.cs, found in the obj directory, now contains below line:

...
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("LINQPadQuery")]
...
1
DaveShaw On

Yes. In LINQPad, go to: Edit, Preferences... and then the Advanced tab, and change the following setting:

enter image description here

And then (as it says in the screenshot) add the following to your project's AssemblyInfo.cs:

[assembly: InternalsVisibleTo("LINQPadQuery")]