Home > Ask the Microsoft .Net Development Experts > Visual Studio .NET Questions & Answers > VB.NET app works on my local drive but not on the network drive
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

VB.NET app works on my local drive but not on the network drive

Chris Sells EXPERT RESPONSE FROM: Chris Sells

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 25 January 2003
I have a VB.NET application that works fine when I run it from any folder on my local drive. But if I try to run it from a networked drive, it fails. The networked drive is a snap server, not a Windows 2000 server. I don't know if that would make a difference or not?

>
The fact that you're running an application from a snap server doesn't matter. However, the fact that you're running a .NET application from a network share matters very much. The security settings in .NET are managed by a part of the runtime known as Code Access Security (CAS). In CAS, permissions are awarded to each assembly based on evidence, that is, some characteristic of the assembly itself, rather than the user that's running the assembly. Examples of evidence include what site an assembly is from, what URL was used to load it, what key was used to sign it and, most commonly, what zone an assembly is from. Anything copied to a computer's hard drive and launched via a drive-based path name is from the My Computer zone and is awarded full trust. However, anything from a network share is from the intranet zone, which means that it's awarded partial trust. The permissions awarded to an assembly from the Intranet zone by default are available via the Microsoft .NET Framework Configuration administration tool and shown in Figure 1.

Figure 1: Default permissions for assemblies from the intranet zone
Figure 1: Default permissions for assemblies from the intranet zone

The set of permissions awarded in the intranet zone are certainly greater than those from the Internet zone, to be sure, but are still not everything that a developer may come to expect when running from the My Computer zone. This unexpected limitation coupled with the relative newness of CAS itself and how CAS is applied for applications launched from network shares often lead a developer to be surprised and frankly, hurt as their advanced are spurned by the .NET runtime. They often want to just go back to the honeymoon of the My Computer zone without really understanding the value that the CAS model offers them.

Luckily, this need is so great and so common that I've written an entire article on how to increase the permissions of an assembly from other than the My Computer zone. It's available as Increasing permissions for Web-deployed WinForms applications, and attempts to convince you of the value of the protection that CAS provides before showing you how to turn it off, much as your significant other may attempt to convince you of the value of settling down before you turn to the arms of another.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Visual Studio .NET (Archive)
What could be causing this problem with my add New and delete methods?
Is there a .NET equivalent to netsend that I can use in VB.NET?
I'm getting a lot of flickering on my application
How can I make a VB6 network app available on the Internet using .NET?
How can I implement an FTP upload using VB.NET?
Is developing add-ons for Windows Explorer supported using managed code in .NET?
In C#, how can I change the properties of controls on another form?
How do I add images in listview by using VB.NET?
What is the best technique for connecting to a database from VB.NET?
How do you use control collection in VB.NET?

Visual Studio .NET
Load a DSL domain model instance file programmatically
Calling via command prompt from ASP.NET
On line-by-line analysis in VS .NET
Best approach for merging text files using arrays
Descriptions of symbols in the class view of a .NET solution
What's the best approach for enumerating network resources?
How to enable a line-by-line code walkthrough
Changing a C++ Makefile project to a Utility project
How can I configure Visual Studio.NET 2002 to use the .NET Framework 1.1?
Changing a datagrid column to read-only=false based on variable

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Windows Development - White Papers, News and Expert Advice
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts