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

How to delpoy a .Net application

P: n/a
I have build a .Net (C#) winform application. The application opens and
reads and writes to an xml file that is stored with the assembly.

When I run the program on my local PC everything works.
I have the need for a number of different people to run the application.
I copied the assembly and related files on a server I connected to the a
share on the server from my local PC and tried running the application I got
an error that said

The Application attempted to perform an operation not allowed by the
security policy. The operation required the secuirtyexception use the
Microsoft.Net security policy administration tool.
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,

if I run the application directly on the server then the application works.
I guess there is an issues running over the network.
The servers and my local pc is part of an Active directory domain
How can I solve this problem and what is the best way to deploy a .Net
application?

thanks in advance
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

The reason you're getting this error is applications that are loaded from a
network share are denied permission to do certain tasks. For example, the
error you received said that your application requested a
System.Security.Permissions.FileIOPermission (it wanted to read from your
local disk) but it was denied.

The technology in .NET that manages this is called Code Access Security
(CAS). Basically every time the CLR loads an assembly (EXE or DLL) it
gathers evidence about it like where the file was located, what it's public
key is, if it has a certain hash or digital signature and so on. Based on
this evidence it grants certain permissions to the code in the assembly and
denies others. Code loaded from your local hard drive has Full Trust,
meaning that the CLR will allow all code in the assembly to run (however
Windows security is still enforced).

As far as deployment goes, what you are trying to do is called No-Touch
Deployment or Smart Client Deployment. It is a great feature of .NET and it
allows full featured Windows Forms apps to be deployed almost as easily as a
web app.

There are tons of great articles and webcasts out there on these topics,
some of which are linked to at http://www.tvbug.com/diary/20030923.htm

--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada

"Thorpe" <p_*****@hotmail.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
I have build a .Net (C#) winform application. The application opens and
reads and writes to an xml file that is stored with the assembly.

When I run the program on my local PC everything works.
I have the need for a number of different people to run the application.
I copied the assembly and related files on a server I connected to the a
share on the server from my local PC and tried running the application I got an error that said

The Application attempted to perform an operation not allowed by the
security policy. The operation required the secuirtyexception use the
Microsoft.Net security policy administration tool.
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,

if I run the application directly on the server then the application works. I guess there is an issues running over the network.
The servers and my local pc is part of an Active directory domain
How can I solve this problem and what is the best way to deploy a .Net
application?

thanks in advance

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.