Unable to Run Exe from Another PC

I have created a Windows based App and is able to run on my own PC (PC A).
Afterwhich, I moved the exe to another PC (PC B) and shared the directory.
At PC A, I map a drive to the directory (V:\).
At another PC (PC C) I also map a V:\ to the directory in PC B.

One weird problem I encountered is on PC C, I am able to run V:\myexe.exe successfully.
However, on PC A, I encounter a runtime error as below

"Request for permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, version=, Culture=neutral, PublicKeyToken=bb77a5c561934e089' failed".
Who is Participating?
hongjunConnect With a Mentor Commented:
Try this

Start -> Control Panel -> Administrative Tool -> Microsoft .NET Framework Configuration
Open Configure Code Access Security Policy -> Adjust Zone Security -> Make changes to this computer.
Give Full Trust for My Computer and Local Intranet.

1. Choose Start -> Control Panel -> Administrative Tools -> Microsoft .NET Framework 1.1 Wizards
2. Choose Trust an Assembly
3. Choose whether you want to make changes for the computer or current user and click Next
4. Enter the UNC location of the application you want to run and click Next
5. Click Next to trust just this assembly
6. Adjust the slider to Full Trust and click Next
7. Click Finish

R u trying access wny Environment variable from ur application??
ee_guestAuthor Commented:
I am trying to get computer name.
I will try when the week starts on monday.
How u r getting the Computer Name??
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.