Home All Groups Group Topic Archive Search About

C#.NET app to run on Win 2003 from another Win2003 on the local net?

Author
30 Aug 2005 2:19 PM
maks
Ok! I have a .NET (C#) app that I'm having a problem running on a Win
2003 box from a different Win 2003 box. I mean files physically are
installed on that second win 2003 server, and I'm trying to start it on
this first one. I get security error. I know about that .NET framework
wizard that allows you to adjust .NET level of protection to
internet/intranet/trusted and so on but that doesn't help.
This doesn't happen on XP/2000. Any ideas!
Thanks a lot in advance!
Please help! It's very urgent!

Author
30 Aug 2005 2:30 PM
Nicole Calinoiu
"maks" <mak***@datacap.com> wrote in message
news:%23gweO3WrFHA.3096@TK2MSFTNGP15.phx.gbl...
> Ok! I have a .NET (C#) app that I'm having a problem running on a Win 2003
> box from a different Win 2003 box. I mean files physically are installed
> on that second win 2003 server, and I'm trying to start it on this first
> one. I get security error.

Would you be able to provide the complete exception details?  (The output
from its ToString method would be best, but anything might help narrow
things down a bit.)


> I know about that .NET framework wizard that allows you to adjust .NET
> level of protection to internet/intranet/trusted and so on but that
> doesn't help.

On which machine did you attempt to run the wizard?  Are you sure you were
granting sufficient permissions for the application to run?


> This doesn't happen on XP/2000. Any ideas!

I'm guessing that the other machines on which you've tested this have
perhaps had some CAS policy modifications applied, possibly via a group
policy object distributed via the domain.  You might want to ask the
relevant network admin(s) about this possibility.


Show quoteHide quote
> Thanks a lot in advance!
> Please help! It's very urgent!
Author
30 Aug 2005 3:05 PM
maks
Thanks you very much for the reply!

Nicole Calinoiu wrote:
> "maks" <mak***@datacap.com> wrote in message
> news:%23gweO3WrFHA.3096@TK2MSFTNGP15.phx.gbl...
>
>>Ok! I have a .NET (C#) app that I'm having a problem running on a Win 2003
>>box from a different Win 2003 box. I mean files physically are installed
>>on that second win 2003 server, and I'm trying to start it on this first
>>one. I get security error.
>
>
> Would you be able to provide the complete exception details?  (The output
> from its ToString method would be best, but anything might help narrow
> things down a bit.)

Here is the exception dump:
System. Security. Policy Exception: Required permissions cannot be acquired.
at TMSubDock.Form1.InitializeComponent
at TMSubDock.Form1..ctor
at TMSubDock.Form1.Main (String[] arg)


>
>
>
>>I know about that .NET framework wizard that allows you to adjust .NET
>>level of protection to internet/intranet/trusted and so on but that
>>doesn't help.
>
>
> On which machine did you attempt to run the wizard?  Are you sure you were
> granting sufficient permissions for the application to run?
>

Only on the Win2003 where I'm trying to run the thing. The second
Win2003 (file server) doesn't even have the framework installed at all.
Checked all the permissions!

>
>
>>This doesn't happen on XP/2000. Any ideas!
>
>
> I'm guessing that the other machines on which you've tested this have
> perhaps had some CAS policy modifications applied, possibly via a group
> policy object distributed via the domain.  You might want to ask the
> relevant network admin(s) about this possibility.
>

It actually sounds more like specific Win2003 issue due to stronger
security on it, may be. Hopefuly that is setable.

Show quoteHide quote
>
>
>>Thanks a lot in advance!
>>Please help! It's very urgent!
>

>
>
Author
30 Aug 2005 6:13 PM
Nicole Calinoiu
"maks" <mak***@datacap.com> wrote in message
news:%23FBe2QXrFHA.3880@TK2MSFTNGP10.phx.gbl...
<snip>
> Here is the exception dump:
> System. Security. Policy Exception: Required permissions cannot be
> acquired.
> at TMSubDock.Form1.InitializeComponent
> at TMSubDock.Form1..ctor
> at TMSubDock.Form1.Main (String[] arg)

A PolicyException usually results from one of the two following
circumstances:

1.  An assembly is denied SecurityPermission\Execution permission under
policy, or
2.  An assembly has one or more RequestMinimum permission attributes, but
CAS policy denies the permission(s) specified by these attribute(s).

Since the exception is thrown from the assembly that contains
TMSubDock.Form1, this is not the assembly that is being denied minimum
permissions under policy.  Instead, you should be looking at the permission
grants to assemblies that might first be loaded in the
TMSubDock.Form1.InitializeComponent method.


>> On which machine did you attempt to run the wizard?  Are you sure you
>> were granting sufficient permissions for the application to run?
>>
>
> Only on the Win2003 where I'm trying to run the thing. The second Win2003
> (file server) doesn't even have the framework installed at all.
> Checked all the permissions!

The assembly that's causing the problem may not even be an assembly that you
authored.  In fact, it might not even be in your network deployment
location.  What happens if you copy the application to the Windows 2003
machine on which it is supposed to run?  Does it run successfully, or do you
still see an exception?  If there's an exception thrown, is it the same
exception?


> It actually sounds more like specific Win2003 issue due to stronger
> security on it, may be. Hopefuly that is setable.

While there are some very small differences between .NET Framework behaviour
on Windows 2003 vs. other Windows versions, I know of no differences in
default CAS policy configuration.  However, regardless of the reason for the
difference in policy (if this is the reason for the failure in the first
place), you'll need to figure out what permissions are missing from which
assemblies before you can adjust the policy to fix the problem...