Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Launching C# .EXE from Network Drive

Reply
Thread Tools Display Modes

Launching C# .EXE from Network Drive

 
 
dm3281
Guest
Posts: n/a

 
      10-21-2007
Hello, everyone.

I'm trying to launch a C# .EXE program from a networked drive using Vista.

I'm getting an exception (I don't remember the exact... something like
access denied or security).

The .EXE is simply a command line program using .NET 2.0 that opens an XML
file and pulls out a message and displays a msgbox. It then closes. The
..EXE reads an .XML file.

If I copy the .EXE and .XML file to my local PC and launch it, it works
fine.

Is there anything I need to do to allow this to work remotely?

Is this a .NET 2.0 security feature or a windows security future?

How do I disable or allow?


 
Reply With Quote
 
 
 
 
Andrew McLaren
Guest
Posts: n/a

 
      10-21-2007
"dm3281" <> wrote ...
> I'm trying to launch a C# .EXE program from a networked drive using Vista.
> I'm getting an exception (I don't remember the exact... something like If
> I copy the .EXE and .XML file to my local PC and launch it, it works fine.
> Is there anything I need to do to allow this to work remotely?
> Is this a .NET 2.0 security feature or a windows security future?


Hi,

This is a .NET security feature.

..NET applications run with "Code Access Security" or CAS - this is a layer
of security, over and above what Windows provides.

CAS distinguishes between EXEs run on the relatively secure local machine,
and EXEs run from the rather less secure network share. By default, code on
a share will run with the security level of LocalIntranet - a lower level of
privilege than if it is run on the local drive.

To run the EXE from a network location, you can use the CASPOL.EXE utility
in .NET to configure a machine policy, to fully trust the network share.
Once this policy is in place, the EXE will run from the share, the same as
if it was on the local hard disk. You can probably configure an equivalent
setting in the application's manifest, but the exact syntax escapes me at
the moment.

Search for ("caspol" and "LocalIntranet") in the .NET SDK, or on Google, to
find lots of info about Code Access Security in .NET.

Hope it helps,

--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
dm3281
Guest
Posts: n/a

 
      10-21-2007
Is CASPOL.EXE on all machines with .NET installed? I'm trying to launch on
Vista Ultimate and it appears not to be found??


"Andrew McLaren" <> wrote in message
news:8B00057C-A915-4FEC-A19D-...
> "dm3281" <> wrote ...
>> I'm trying to launch a C# .EXE program from a networked drive using
>> Vista.
>> I'm getting an exception (I don't remember the exact... something like If
>> I copy the .EXE and .XML file to my local PC and launch it, it works
>> fine.
>> Is there anything I need to do to allow this to work remotely?
>> Is this a .NET 2.0 security feature or a windows security future?

>
> Hi,
>
> This is a .NET security feature.
>
> .NET applications run with "Code Access Security" or CAS - this is a layer
> of security, over and above what Windows provides.
>
> CAS distinguishes between EXEs run on the relatively secure local machine,
> and EXEs run from the rather less secure network share. By default, code
> on a share will run with the security level of LocalIntranet - a lower
> level of privilege than if it is run on the local drive.
>
> To run the EXE from a network location, you can use the CASPOL.EXE utility
> in .NET to configure a machine policy, to fully trust the network share.
> Once this policy is in place, the EXE will run from the share, the same as
> if it was on the local hard disk. You can probably configure an equivalent
> setting in the application's manifest, but the exact syntax escapes me at
> the moment.
>
> Search for ("caspol" and "LocalIntranet") in the .NET SDK, or on Google,
> to find lots of info about Code Access Security in .NET.
>
> Hope it helps,
>
> --
> Andrew McLaren
> amclar (at) optusnet dot com dot au
>


 
Reply With Quote
 
Andrew McLaren
Guest
Posts: n/a

 
      10-21-2007
"dm3281" <> wrote in message
news:7F554B69-E50F-4B77-96EE-...
> Is CASPOL.EXE on all machines with .NET installed? I'm trying to launch
> on Vista Ultimate and it appears not to be found??


It ships as part of the .NET SDK. It's not included in the .NET
Redistributable, which is what end-users will have installed on their
machines. But you can copy the EXE from a developer machine to the end-user
machine, and run it there.

For more info on CASPOL, see:
http://msdn2.microsoft.com/en-us/lib...tz(VS.80).aspx

..NET Framework SDK can be downloaded from here:
http://msdn2.microsoft.com/en-au/net.../aa569263.aspx

This is a .NET issue. It's not really related to Vista, as such. For
assistance using CASPOL ... well, your best bet will be to talk to the
developer of the .NET EXE, and see what he/she thinks is the best solution:
caspol, manifest, or NET Framework Configuration tool (mscorcfg.msc).
Security in .NET can be a huge and complex topic; simple answers from
newsgroups could be misleading or misguided. But for newsgroup help, you'll
get better info by asking in a group like microsoft.public.dotnet.general.

Good luck with it,
--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
trouble moving files from local drive to network drive dwsdad Windows Vista Networking 0 02-25-2008 11:32 AM
Network Repair Wizard keep launching Ehlersgrub Windows Vista Networking 2 02-21-2008 01:19 AM
Map a Network Drive on Vista Premium on Network Attached Storage ( OverDose Windows Vista Networking 1 01-19-2008 12:42 AM
Unable to map network drive because no network was found DK Windows Vista Networking 6 12-19-2007 02:06 PM
Network Mapped Drive : Lost Network Connection Ian Robert Windows Vista Networking 14 08-24-2007 09:58 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59