Re: Security Exception when deploying a VB.NET 2003 Solution
- From: "John Kotuby" <johnk@xxxxxxxxxxxxx>
- Date: Fri, 16 Jun 2006 10:40:43 -0400
Thanks Norman,
I guess I will need to spend some time on .NET security. I still can't
figure out why the App runs from the Network Share that it was originally
compiled to. It runs fine on any workstation. My only guess is that the
Assemblies were compiled with reference to a String Name Key file .SNK in a
folder 2 levels up from the BIN folder where the application resides.
I went into the .NET configuration utility on another WinXP workstation that
will allow code to run from the DEVELOPMENT share (where the SNK file
resides). To my surprise there was already an entry there for
file://server/development/* URL. I did not put it there.
When I tried to add another identical entry with a different URL
file://server/testing/* the exact same code copied to a folder under the
"testing" share would not run -- security exception.
Go figure...
"Norman Yuan" <NotReal@xxxxxxxxxxx> wrote in message
news:eiZOA2%23jGHA.4588@xxxxxxxxxxxxxxxxxxxxxxx
See comment inline.
"John Kotuby" <johnk@xxxxxxxxxxxxx> wrote in message
news:ukYj4L9jGHA.1204@xxxxxxxxxxxxxxxxxxxxxxx
Hello all,
About a year ago I wrote a VB.NET 2003 solution that consists of a
number of assemblies (1 EXE and 15 DLLS). As I recall, in order to
deploy the solution to a testing server I simply copied the contents of
the Bin folder in the development area where the compiled assemblies
reside. Be patient with me here, because I haven't used .NET since then
... our primary development environment is still VB6, as we have a large
application with 6 years devoted to it and are not quite ready to do a
complete re-write in .NET.
The .NET project which had been dormant for a year is now back in action.
I tried creating an MSI install project from within the solution. It
appeared to include the primary EXE all the necessary dependencies (I
don't even remember how I created that Installer at the moment).
The bottom line is that now when I try to deploy to either a Test Server
share or a local workstation (which is a member of a Domain), I get
Microsoft .NET security errors upon trying to start the Executable.
Examples:
Local Workstation:
"An unhandled exception has occurred....
"Access to the path 'C:\Program Files\Testing' is denied.
I bet the workstaion is WinXP and your app is trying to write data(
settings?) to C:\Program Files\... folder.
On WinXP, by default, ordinary user does not have permission to write to
C:\Program files folder (and subfolders). It is also not following Windows
app development rule to save app/user specific in this folder. You should
look into C:\Documents and Settings\...to save that kind of data (or
Registry, not recommended too, in many cases). If you do not want to
modify the app, you may want to install the app in other folder and then
make sure user has permission to write data in that folder.
Server Share:
"The application attempted to perform an operation not allowed by the
security policy. The operation required the SecurityException. To grant
this application the required permission please contact your system
administrator, or use the Microsoft .NET security policy administrator."
This is .NET default security settings: any code loaded from outside the
running computer is considered unsafe. If you want to load your app from a
network share, you need to configure the .NET (Control Panel->Microsoft
.NET Framework 1.xx/2.0 Configuration) to allow code from specific
location (Intranet, or a folder on the Intranet, or a Group of Code...) to
run.
If you really do not spend much time to learn all of these stuff, you can
simply use XCopy (copy all the files, EXE and DLLs into a folder on a
computer) to deploy the app. This the simplest way to solve your immediate
problem.
So, I used the .NET 1.1 and 2.0 Configuration tools to try to create a
Runtime Security Code Group to allow the program to run. I don't remember
having to do this last year...strangely enough. I was not able to
successfully get the program to execute after a few hours of reading
documentation and trying different things in the Configuration tools. The
documentation and even the tools themselves are somewhat inscrutable to
the uninitiated.
.
- References:
- Security Exception when deploying a VB.NET 2003 Solution
- From: John Kotuby
- Re: Security Exception when deploying a VB.NET 2003 Solution
- From: Norman Yuan
- Security Exception when deploying a VB.NET 2003 Solution
- Prev by Date: Re: Intellisense for JavaScript?
- Next by Date: Re: VS2005 crashing when trying to Build a solution stored on a network drive
- Previous by thread: Re: Security Exception when deploying a VB.NET 2003 Solution
- Next by thread: Security Exception when deploying a VB.NET 2003 solution.
- Index(es):
Relevant Pages
|
|