VS.NET application security when starting Application from network
- From: "Christian Muggli" <christian.muggli@xxxxxxxxxxxxxxxxx>
- Date: Mon, 4 Dec 2006 11:41:37 +0100
Hello folks
following situation:
- we built an application (windows application) with VS.NET 2005/VB.NET
- Application does:
- collect inventory (Win32Product and Win32QuickFixEngineering)
information using WMI (System.Management)
- reads/writes a registry key for a UID (to identify the device)
- connects to a central SQL Server and submit the collected inventory
information
The application must be started from a Network (UNC) Path.. usually this
will be the Netlogon Share, using a Logon Script.
The challenge (problem) we've faced is .NET Security. We do NOT want to
deploy the application using ClickOnceDeploy, nor we want to install a
Security template or something simliar. do we really have to call caspol.exe
in the login script to manage the code access security ? or how can we
'sign' or authorize the .NET App to run from a network share? we already
thought about going down to vb6/vc6 to get rid off that problem.
(application runs smooth when started locally..)
what we get when we start the App is:
---
System.Security.SecurityException: Request for the permission of type
'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at Microsoft.Win32.RegistryKey.CheckSubKeyReadPermission(String
subkeyName)
at Microsoft.Win32.RegistryKey.CheckOpenSubKeyPermission(String
subkeyName, Boolean subKeyWritable)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at cxnInvColWorker.basRegistry.RegistryGetValue(String sKey, String
sValue, String sDefaultValue)
at cxnInvColWorker.formMain.formMain_Load(Object sender, EventArgs e)
..
..
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.RegistryPermission
The Zone of the assembly that failed was:
Intranet
---
************** Exception Text **************
System.Security.SecurityException: That assembly does not allow partially
trusted callers.
at
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh,
SecurityAction action, Object demand, IPermission permThatFailed)
at cxnInvColWorker.formMain.btnSWInv_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The action that failed was:
LinkDemand
The Zone of the assembly that failed was:
Intranet
---
can someone point me in a direction?
helps really appreciated!
Christian
.
- Follow-Ups:
- Re: VS.NET application security when starting Application from network
- From: Norman Yuan
- Re: VS.NET application security when starting Application from network
- Prev by Date: Re: What is the role of SQL Server 2005 Reporting Services ?
- Next by Date: Re: Testing on win xp and win Vista, backup does not work
- Previous by thread: annoyed question: is it possible to write a plugin for VS to...
- Next by thread: Re: VS.NET application security when starting Application from network
- Index(es):