• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3710
  • Last Modified:

Running .Net Application from Network Drive

Hello Experts.

I hope someone can help.

I have an application built in .Net. The client computers have the .Net Framework installed. I can run the application locally with no errors, however. if i put the exe on a network drive it will not run. i always get

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 administration tool.

Request for the permission of type Sytem.Security.Permissions.SecurityPermission, mscorlib, version=1.0.3300.0, Culture=neutral PublicKeyToken-b77a5c561934e089 failed.

Infact when i put my source code on a network drive, it won't load in the IDE. I get
The project location is not fully trusted by the .Net runtime. This is usually because it is either a network share or mapped to a network share not on the local machine. If the output path is under the project location, your code will not execute as fully trusted and you may receive unexpected security exception.

is there some way to allow .Net wo work with all this stuff on a network. I'm hopeing i can just add something that allows me to develop and run any .Net application from anywhaere on my domain.
0
wraith821
Asked:
wraith821
  • 4
  • 4
  • 3
  • +1
2 Solutions
 
plqCommented:
I think its because the assembly is not trusted

Do start - administrative tools - Microsoft .NET Framework 1.1 Wizards

The first two options may help. Adjust .NET security might allow you to generally allow any .net app. Trust an Assembly allows you to allow a specific app.

I think to have it run on ANY machine you'll need to front end your .NET program with a VB6 exe that programmatically changes .NET security, and then call the .NET program using shell. I don't know how the VB6 program would do that though !
0
 
NetworkArchitekCommented:
This blog may give you some information. I've run across this before, it's by design.

http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx
0
 
Éric MoreauSenior .Net ConsultantCommented:
You need to adjust the security.

Open the Control Panel
Open Administrative tools
Open Microsoft .Net Framework 1.1 Wizards
Click Adjust .Net Security
click Next
Select Local Intranet
Change the level of trust to Full
click next
click Finish
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
wraith821Author Commented:
still no luck. i have tried all the above suggestions.
0
 
plqCommented:
Hmm can you run the EXE from the network drive on your machine ?
0
 
wraith821Author Commented:
No that is not possible. I can't even run the code in the IDE.
0
 
Éric MoreauSenior .Net ConsultantCommented:
What if the source code is local on your hard disk ?
0
 
plqCommented:
he's already said he can >>I can run the application locally with no errors, however. if i put the exe on a network drive it will not run. i always get<<

I just did a quick test here by moving an EXE to a share and it still runs fine.

Just to double check:

- Did you give the app a strong name with sn -k ?
- Did you add an AssemblyKeyFileAttribute ? then recompile
- Trust all versions with full trust with the same key (using .net wizards trust an assembly)
- Enable full trust on local intranet
0
 
Éric MoreauSenior .Net ConsultantCommented:
Something went wring when you change the security. Are you using VS.Net 2003 ?
0
 
wraith821Author Commented:
emoreau
 Are you using VS.Net 2003 ? [No, its 2002 with sp1]

plg
- Did you give the app a strong name with sn -k ? [No]
- Did you add an AssemblyKeyFileAttribute ? then recompile [No]
- Trust all versions with full trust with the same key (using .net wizards trust an assembly) [Yes]
- Enable full trust on local intranet [Yes]

I will go and try the strong name and the Key File
0
 
Éric MoreauSenior .Net ConsultantCommented:
do the same procedure I already gave you but with the 1.0 wizard
0
 
wraith821Author Commented:
Thank you both, I wish I could have given you 500 each but it wouldn't let me. you both were a big help and have made my life much easier. I had no idea it was that easy. But then again if it were i wouldn have two experts helping me.

Again Thanks
Nick
0
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.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now