Article ID: 832742 - Last Review: November 29, 2007 - Revision: 2.1 How to deploy a .NET Framework application to run from a network locationCaution ADO and ADO MD have not been fully tested in a Microsoft .NET Framework environment. They may cause intermittent issues, especially in service-based applications or in multithreaded applications. The techniques that are discussed in this article should only be used as a temporary measure during migration to ADO.NET. You should only use these techniques after you have conducted complete testing to make sure that there are no compatibility issues. Any issues that are caused by using ADO or ADO MD in this manner are unsupported. For more information, see the following article in the Microsoft Knowledge Base: 840667
(http://support.microsoft.com/kb/840667/
)
You receive unexpected errors when using ADO and ADO MD in a .NET Framework application On This PageSUMMARYThe step-by-step article describes how to deploy an application that is built on the Microsoft .NET
Framework to run from a network drive. RequirementsThis article assumes that you are familiar with the following topic:Programming by using Microsoft Visual Basic .NET The following list outlines the recommended hardware, software,
network infrastructure, and service packs that you need:
Determine the trust levelSecurity is an important concern when you build an application. The common language runtime grants different levels of trust to code based on specific attributes (named evidences) that the code possesses.When the common language runtime determines that code has a specific level of trust, the common language runtime permits the code to access resources that are protected by that level of trust. By default, a .NET Framework application that runs from the Internet does not have the same level of trust as a .NET Framework application that runs from your local computer. An application that runs from your local computer can access resources such as the file system. However, an application that runs from the Internet or from a local intranet cannot access the file system on your local computer. Typically, the default security policy is sufficient for your application. Microsoft recommends that you change this security policy only if you must. You can use the .NET Framework configuration tool (Mscorcfg.msc) to change the security policy. In the .NET Framework, code access security controls access to resources by controlling how code runs. When a user runs an application, the common language runtime assigns the application to any one of the following five zones:
Trust levels define the resources that the application can access. The zone, together with other security evidence, such as the publisher, the strong name, the Web site, and the URL of the code, determines the permissions that the common language runtime grants to the code at run time. Because, you cannot control the security settings on a user's computer, your application must work within the existing settings. Therefore, some resources may not be available to your application. For example, your application may have to write data to a file. However, the user's computer may raise an exception at run time to deny write access for your application. Grant permission to the applicationAn application that is hosted on a network drive can run on your local computer. To run the application, you must grant a level of trust to the assembly that corresponds to the application. The trust level setting ranges from None to Full Trust. To run the application on your local computer, you must grant Full Trust permission to the assembly.Create a console application
Map the network drive and deploy the compiled application
Assign Full Trust permission
REFERENCES
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
300856
(http://support.microsoft.com/kb/300856/
)
How to connect to shared folders over the network (on a domain) in Windows 2000
For more information about the security aspects
of running an assembly from a network drive, visit the following Microsoft
Developer Network (MSDN) Web sites: http://msdn2.microsoft.com/en-us/library/aa289516(VS.71).aspx
(http://msdn2.microsoft.com/en-us/library/aa289516(VS.71).aspx)
http://msdn2.microsoft.com/en-us/library/ms994923.aspx (http://msdn2.microsoft.com/en-us/library/ms994923.aspx) APPLIES TO
| Article Translations
|

Back to the top
