Links in Roslyn.rsp files

I see in CSharpInteractive.rsp you can add a link to a DLL in the GAC using / r:

How do you add links to your own dlls?

I tried System.Reflection.Assembly.LoadFrom, this did not work, but did not work.

I am trying to add a link to my DLL that has extension methods.

If I try to add code for the extension method directly in the interactive window, I get this error:

bug CS1109: extension methods must be defined in a static top-level class; XYZ - nested class

+6
source share
1 answer

You should be able to specify the full path to build just like gac build.

Usually you do not need to change rsp. You can add links to a regular message using:

#r "path" 

Disclaimer: I work for Microsoft on the Roslyn team.

+8
source

Source: https://habr.com/ru/post/900005/


All Articles