PC Review


Reply
Thread Tools Rate Thread

C# network security management

 
 
cryptic
Guest
Posts: n/a
 
      28th Feb 2008
I created a C# assembly with no security permissions, started it from a
mapped network drive and execute a file io algorithm - it fails with a
SecurityException (FileIOPermission). If I added a FileIOPermissionAttribute
and a ClickOnce Manifest, it fails with the same error. Next step was that I
execute the mscorcfg.msc and config the zonerights for the hole computer, the
result: it works. My question: If I create a assembly for a customer and they
will execute the asm from a mapped drive, it's really necessary that I give
the customer a *.msi package with full network rights or give it another way,
because it seems that the logical way not worked when the zonerights are not
setup.
Next: Has anybody a german article about this problem?
 
Reply With Quote
 
 
 
 
Norman Yuan
Guest
Posts: n/a
 
      28th Feb 2008
That is not a problem, it is the way how .NET code works. You need to learn
a little bit on .NET Code Access Security (CAS). Googling ".NET code access
security" brings you tons of links. .NET documentation is also good source
of learning.

To simplize it, .NET treat all code loaded from outside running computer as
unsafe (not trusted) by default. You need to configure the running computer
to give certain trust to the code loaded from somewhere other than from
local disk. You use .NET framework configuration applet (mscorcfg.msc, only
available with .NET 1.1 and .NET2.0 SDK) or CASPOL.exe (.NET2.0 without SDK)
to do that.

If you do not want to (or do not know how to) do this CAS configuration, you
need to install your app (WIN form app) to each running computer (most Win
form apps are still deployed this way). To run your app from network drive,
it is maybe too much to give full trust to entire intranet/LAN. It is better
ti scale down the CAS scope to its really needed, such as only give a
certain network folder needed trust.

"cryptic" <(E-Mail Removed)> wrote in message
news:1CAA7708-35EA-4B16-9F9A-(E-Mail Removed)...
>I created a C# assembly with no security permissions, started it from a
> mapped network drive and execute a file io algorithm - it fails with a
> SecurityException (FileIOPermission). If I added a
> FileIOPermissionAttribute
> and a ClickOnce Manifest, it fails with the same error. Next step was that
> I
> execute the mscorcfg.msc and config the zonerights for the hole computer,
> the
> result: it works. My question: If I create a assembly for a customer and
> they
> will execute the asm from a mapped drive, it's really necessary that I
> give
> the customer a *.msi package with full network rights or give it another
> way,
> because it seems that the logical way not worked when the zonerights are
> not
> setup.
> Next: Has anybody a german article about this problem?


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network management as a means of providing network security kalyan Windows XP Networking 4 30th Apr 2008 04:25 PM
Security Management - How to aaapaul Microsoft ASP .NET 0 12th Apr 2006 03:18 PM
Security management console Plums Windows XP Security 1 26th Jan 2004 11:41 PM
Computer Management security =?Utf-8?B?TWljazM1?= Microsoft Windows 2000 Security 6 14th Jan 2004 01:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:44 AM.