Re: Error when executing from a network share
- From: "SvenC" <Cven.Sarstensen@xxxxxxx>
- Date: Thu, 7 Sep 2006 14:28:57 +0200
Hi Dirk,
"dirk" <dirk.kapusta@reply_in_newsgroup> wrote in message
news:ut8XkKm0GHA.4392@xxxxxxxxxxxxxxxxxxxxxxx
Hello SvenC
Is there a recommended way to check whether FullTrust (or whatever is
required) is granted. I think an application should check this when
starting
and show a more informative dialog, so that a normal user can solve the
problem. Probably this should be done by the runtime, depending on the
assembly you may not get a chance to do any checks.
I guess this is by design impossible because if you could catch that
exception you could in fact run all code you like and do whatever the
currently logged on user can do in his logon session. You might get around
this if you split your assembly into a safe one that will not require
FullTrust. That might demand FullTrust and if available dynamically load
another assembly or else display an error message. I guess the problem might
be that for loading assemblies dynamically you will again need FullTrust.
Bottom line could be: use a technique like ClickOnce to deploy your apps to
get client machines configured correctly.
--
SvenC
Dirk
"SvenC" <Cven.Sarstensen@xxxxxxx> wrote in message
news:ujbfwYk0GHA.3512@xxxxxxxxxxxxxxxxxxxxxxx
Hi Jose,
"Jose Cintron" <l0rddarkf0rce@xxxxxxxxxxx> wrote in message
news:%23kk4hMe0GHA.3656@xxxxxxxxxxxxxxxxxxxxxxx
I created a pretty basic program based on the "Windows Forms<snip/>
Application"
template using C++ in VS 2005. When I run the program from my local
system
it runs properly (do happy dance), now when I copy the same program to a
network share (I have a drive mapped to it) and execute the same program
I
get an error message that reads
=== Start Error Pop-up Window ===
Reporter.exe has encountered a problem and needs to close. We
are sorry for the inconvenience.
Additional information: Could not load file or assembly 'Reporter,
Version=1.0.2439.41345, Culture=neutral, PublicKeyToken=null' or one of
its dependencies. Failed to grant minimum permission requests.
(Exception
from HRESULT: 0x80131417)
=== End Debug message ===
Any ideas on what the heck does this means? Do I have to set something
in
my project to allow the program to run from a network share (that would
be
stupid). TIA!
Only assemblies in the local computer zone have full trust and that is
the
failing mimimum permission.
You can use the "Microsoft .Net Framework 2.0 Configuration" console. On
my
machine its in Start > Administrtative Tools. Might depend on the version
of
VC++ your are using if it is present or not. It is part of the .Net 2.0
SDK.
Open My Computer > Runtime Security Policy > Machine > Code Groups >
All_Code
Right click and choose New...
Give it a name, e.g. "C++ test". Next
Choose URL as condition type and type the UNC path of your app: either
complete with "...\your.exe" or only the path followd by "\*" to
configure
all assemblies in that path. Next
Use "FullTrust" permission set. Next. Finish
Start your app...
You might also sign your assembly. Then you can use Strong Name or
Publisher
instead of URL.
Lookup the documentation for caspol to find a command line tool to
create/set those code permission.
--
SvenC
.
- References:
- Re: Error when executing from a network share
- From: SvenC
- Re: Error when executing from a network share
- From: dirk
- Re: Error when executing from a network share
- Prev by Date: Re: Error when executing from a network share
- Next by Date: Re: DATE to string
- Previous by thread: Re: Error when executing from a network share
- Next by thread: Re: Error when executing from a network share
- Index(es):
Relevant Pages
|