Karathan
Karathan

Reputation: 159

Roslyn list of #r references

In the Roslyn scripting environment if the user creates scripts he has the ability to reference assemblies like #r "Assembly.dll" or #r "System.Drawing" things like that. Is there a way to get all of these out of a file before executing it? I basically do not want to create a huge security problem when the user has access to like... everything.

Upvotes: 1

Views: 1440

Answers (1)

Jason Malinowski
Jason Malinowski

Reputation: 19031

If you want to get the list of references that were #r'ed, you can access that from Compilation.DirectiveReferences.

Upvotes: 2

Related Questions