Estoy probando mi aplicación en el Guest del usuario. Se bloquea con el siguiente error.'UnauthorizedAccessException' - 'Global .net clr networking'
'UnauthorizedAccessException' - 'Global.net redes clr'
Ahora, sé que puedo editar la política de seguridad en la máquina para permitir que el código CLR se ejecuta bajo invitados de fiar, pero ¿qué se debería hacer en una aplicación comercial?
(¿Firma y agrega los atributos del CAS?) Actualmente estoy leyendo toda la sección de seguridad, pero estoy en un apuro de tiempo, por lo tanto, apreciaré cualquier apuntador en la dirección correcta.
EDITAR: He rastreado el problema hasta utilizar la clase Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase. Si esto está incluido, aparece el error. Estoy buscando algo para agregar al manifiesto o de alguna otra manera para que cuando la aplicación se instala/ejecuta, le pida los permisos apropiados. No quiero tener que pedirle al usuario que llame personalmente a caspol o alguna otra herramienta.
Detalles Entorno: - App está utilizando .NET 3.0 - OS es Vista
Aquí está el seguimiento de la pila relevante para los interesados en estas cosas:
Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'Glo
bal\.net clr networking' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Threading.Mutex.<>c__DisplayClass3.<.ctor>b__0(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCl
eanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean&
createdNew, MutexSecurity mutexSecurity)
at System.Diagnostics.SharedUtils.EnterMutexWithoutGlobal(String mutexName, M
utex& mutex)
at System.Diagnostics.SharedPerformanceCounter.Verify(CategoryEntry* currentC
ategoryPointer)
at System.Diagnostics.SharedPerformanceCounter.FindCategory(CategoryEntry** r
eturnCategoryPointerReference)
at System.Diagnostics.SharedPerformanceCounter.GetCounter(String counterName,
String instanceName, Boolean enableReuse, PerformanceCounterInstanceLifetime li
fetime)
at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String c
ounterName, String instanceName, PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
at System.Net.NetworkingPerfCounters.Initialize()
at System.Net.Configuration.SettingsSectionInternal..ctor(SettingsSection sec
tion)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.Sockets.Socket.get_SupportsIPv4()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.get_
HostName()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Regi
sterChannel(Boolean SecureChannel)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(
String[] commandLine)
¿Dónde se cuelga? ¿En el arranque? Durante el funcionamiento normal? – blowdart
durante el inicio, antes de que se ejecute cualquier parte de mi código. – moogs