By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,671 Members | 1,568 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,671 IT Pros & Developers. It's quick & easy.

How restrict some assembly

P: n/a
Hi,

I am using codeDom class to compile on fly some c# code. I want to restrinc
to use some assembly, i don't know if assembly is the best word, i want to
forbid to use class like System.IO.File or System.IO.Directory, how can i do
it??

I thought i can do it parsing the code looking for the key word, but i think
can be another profesional solution.

Sorry my english.

Thank, Dani
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

You can restrict access in a declarative way using assembly attribute and
more precisely System.Security.Permissions.FileIOPermission.

See http://blogs.msdn.com/shawnfa/archiv...30/222918.aspx
and
http://msdn.microsoft.com/library/de...classtopic.asp
for more.

I hope it could help.

Lionel.
"Dani" <da***************@hotmail.com> a écrit dans le message de news:
eO**************@tk2msftngp13.phx.gbl...
Hi,

I am using codeDom class to compile on fly some c# code. I want to
restrinc to use some assembly, i don't know if assembly is the best word,
i want to forbid to use class like System.IO.File or System.IO.Directory,
how can i do it??

I thought i can do it parsing the code looking for the key word, but i
think can be another profesional solution.

Sorry my english.

Thank, Dani

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.