|
 |
 |
 |
 |
Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms
of Use |
Trademarks
Article ID: 837909 - Last Review: May 18, 2007 - Revision: 4.6 How to configure .NET Framework security settings and how to deploy a .NET Framework applicationTo configure security settings and to deploy a Microsoft .NET Framework application on a remote computer, follow these steps: On the local computer, create a .NET Framework application. Configure the security settings for your .NET Framework application by using the Code Access Security Policy tool (Caspol.exe) on the remote computer. Deploy your .NET Framework application on the remote computer.
This step-by-step article describes how to configure the
runtime security policies of .NET Framework applications so that these
applications can be accessed from a remote computer. Create a Console Application project in Visual Basic .NET- On the local computer, start Microsoft Visual Studio
.NET.
- On the File menu, point to
New, and then click Project. The New
Project dialog box appears.
- Under Project Types, click Visual
Basic Projects.
- Under Templates, click Console
Application. In the Location box, type
C:\, and then click OK. By default, a
project that is named ConsoleApplication1 and a module file that is named
Module1.vb are created.
Note Notice that a folder that is named ConsoleApplication1 is created
on drive C on your computer. - In the Module1.vb file, replace the existing code with the
following code:
Module Module1
Sub Main()
Console.WriteLine("Starting test...")
Console.Read()
End sub
End Module
- On the Build menu, click Build
Solution.
- Start Windows Explorer. Locate the ConsoleApplication1
folder on drive C on your computer. Double-click the
ConsoleApplication1 folder. Notice that the
ConsoleApplication1 folder contains a folder that is named Bin.
- Share the Bin folder.
Configure the security policy settings on the remote computerWhen you try to access a .NET Framework application from a remote
computer, you may receive a System.SecurityException exception error message or a security warning
message. To make your .NET Framework application fully trusted, you
can use the Code Access Security Policy tool (Caspol.exe). To do this, follow
these steps:
- Click Start, and then point to
Programs.
- Do one of the following, depending on the version of Visual
Studio .NET that you have:
- If you are using Visual Studio .NET 2003, point to
Microsoft Visual Studio .NET 2003, point to Visual
Studio .NET Tools, and then click Visual Studio .NET 2003
Command Prompt. The Visual Studio .NET 2003 Command
Prompt window opens.
- If you are using Visual Studio .NET 2002, point to
Microsoft Visual Studio .NET, point to Visual Studio
.NET Tools, and then click Visual Studio .NET Command
Prompt. The Visual Studio .NET Command Prompt window
opens.
- Do one of the following, depending on the version of Visual
Studio .NET that you have:
Note In this command, servername is a
placeholder for the name or for the IP address of the local computer where you
created your .NET Framework application in the "Create a console application in
Visual Basic .NET" section.
Note The security policy settings for the Microsoft .NET Framework 1.1
and for the Microsoft .NET Framework 1.0 are independent of each other.
Deploy the application on the remote computerOn the remote computer, you can deploy the compiled application by
using one of the following methods:
- Map a network drive, and then deploy the
application.
- Deploy the application by using a .NET deployment
package.
- Deploy the application by using no-touch
deployment.
Map a network drive, and then deploy the application For more information
about how to deploy the application by mapping a network drive, click the
following article number to view the article in the Microsoft Knowledge Base: 832742Â
(http://kbalertz.com/Feedback.aspx?kbNumber=832742/
)
How to deploy a .NET Framework application to run from a network location
Deploy the application by using a .NET deployment packageThe Microsoft .NET Framework is included with a graphical user
interface (GUI) configuration tool that you must use to make security policy
changes. This tool also contains a wizard that helps you create a
self-contained Microsoft Windows Installer package (.msi) file out of a
security policy level. The security policy is administered through settings at
the following three policy levels:
- The enterprise policy level
The enterprise policy level maps to the policy level that has
been defined for the whole enterprise network. - The machine policy level
The machine policy level defines the permissions that apply
to a specific computer. - The user policy level
The user policy level defines the permissions that apply to
the logged on user.
For
more information about how to deploy the application by using a .NET deployment
package, click the following article number to view the article in the
Microsoft Knowledge Base: 815173Â
(http://kbalertz.com/Feedback.aspx?kbNumber=815173/
)
How to build and deploy a .NET security policy deployment package
Deploy the application by using no-touch deploymentThe main advantage of using no-touch deployment is that the
application can be run and can be deployed without always providing the user
name and the password. To deploy a .NET Framework application by using
the no-touch deployment method, follow these steps:
- Create a user account that has the same user name and the
same password on both the local computer and the remote computer. To do this,
follow these steps:
- Right-click My Computer, and then
click Manage.
- Expand Local Users and Groups, and
then right-click Users.
- Click New User. The New
User dialog box appears.
- In the following boxes, type the information that you
want to use for the new user account:
- User name
- Full name
- Description
- Password
- Confirm password
- Click to clear the User cannot change
password check box.
- Click to select the Password never
expires check box.
- Click Create.
- On the local computer, grant permissions for the
application folder that contains the application that you created in the
"Create a Console Application project in Visual Basic .NET" section. To do
this, follow these steps on the local computer:
- Start Windows Explorer.
- Locate the ConsoleApplication1 folder
on drive C on your computer.
- Double-click the ConsoleApplication1
folder, and right-click the bin folder, and then click
Properties. The bin Properties dialog box
appears.
- Click the Sharing tab.
- On the Sharing tab, make sure that the
Share this folder option is selected.
- Click Permissions. The
Permissions for bin dialog box appears.
- Click the Share Permissions
tab.
- On the Share Permissions tab, click
Add. The Select Users, Computers, or Groups
dialog box appears.
- Enter the user account that you created in step 1, and
then click OK.
- In the Permissions section, click to
select the Full Control check box under
Allow, and then click OK.
Note If the file system on your computer is FAT32, go to step
3. - On the Security tab of bin
Properties dialog box, click Add. The Select
Users, Computers, or Groups dialog box appears.
- Repeat steps j and k.
- On the remote computer, open the folder that contains your
application. To do this, follow these steps:
- Click Start, and then click
Run.
- In the Open box, type the following:
\\servername Note In this command, servername is a
placeholder for the name or the IP address of the local computer where you
created your .NET Framework application in the "Create a Console Application
project in Visual Basic .NET" section. - Click OK. You receive a message to
provide credentials.
- Provide the user name and the password that you created
in step 1.
- Click Start, and then click
Run.
- In the Open box, type
inetmgr, and then click OK. The
following behavior occurs, depending on the operating system that you have:
- On Windows Server 2003, the Internet
Information Services (IIS) Manager window appears.
- On Windows 2000 Server and on Windows XP, the
Internet Information Services window appears.
- In the window that appears in step 5, expand your
server.
- Do one of the following, depending on the operating system
that you have:
- On Windows 2000 Server, right-click Default Web
Site, and then click New Virtual Directory. The
Virtual Directory Creation Wizard appears.
- On Windows Server 2003 and on Windows XP, expand
Web Sites, right-click Default Web Site, and
then click New Virtual Directory. The Virtual
Directory Creation Wizard appears.
- Click Next.
- In the Alias box, type
TestApp, and then click
Next.
- In the Directory box, type
\\servername\bin, and then
click Next.
- Provide the user name and the password that you created in
step 1, and then click Next.
- In the Confirm Password dialog box, type
your password in the Please re-enter the password to confirm
box, and then click OK.
- Click Next, and then click
Finish to close the wizard. Notice that a virtual directory
that is named TestApp is created under Default Web Site in
Microsoft Internet Information Services (IIS).
- Click the TestApp virtual directory. In
the right pane, notice the ConsoleApplication1.exe file on the
Name tab.
- Right-click ConsoleApplication1.exe, and
then click Browse. Notice that the application runs
successfully.
For more information, visit the following Microsoft
Developer Network (MSDN) Web sites:
APPLIES TO- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
| kbhowtomaster kbuser kbtrusts kbnetwork kbpolicy kbdeployment kbsecurityservices KB837909 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
|
 |
 |
 |
 |
 |
 |
 |
| |