Asp.net mscorlib异常
有人能告诉我我的web应用程序有什么问题吗?当我尝试从VS2008运行此项目时,我得到了以下信息:Asp.net mscorlib异常,asp.net,sql,visual-studio-2008,Asp.net,Sql,Visual Studio 2008,有人能告诉我我的web应用程序有什么问题吗?当我尝试从VS2008运行此项目时,我得到了以下信息: System.Security.SecurityException was unhandled Message="Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKey
System.Security.SecurityException was unhandled
Message="Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
Source="mscorlib"
StackTrace:
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at MS.Internal.PresentationFramework.SecurityHelper.DemandUnmanagedCode()
at System.Windows.Window..ctor()
at System.Windows.Application.GetAppWindow()
at System.Windows.Application.ConfigAppWindowAndRootElement(Object root, Uri uri)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at XamlGeneratedNamespace.GeneratedApplication.Main()
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
未处理System.Security.SecurityException
Message=“请求'System.Security.Permissions.SecurityPermission,mscorlib,Version=2.0.0,Culture=neutral,PublicKeyToken=b77a561934e089'类型的权限失败。”
Source=“mscorlib”
堆栈跟踪:
在System.Security.CodeAccessSecurityEngine.Check(对象请求、堆栈爬网标记和堆栈标记、布尔isPermSet)
在System.Security.CodeAccessPermission.Demand()中
位于MS.Internal.PresentationFramework.SecurityHelper.DemandUnmanagedCode()处
在System.Windows.Window..ctor()中
在System.Windows.Application.GetAppWindow()中
位于System.Windows.Application.ConfigAppWindowAndRooteElement(对象根,Uri)
在System.Windows.Application.DoStartup()中
在System.Windows.Application.b__0上(对象未使用)
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、布尔isSingleParameter)
位于System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源、委托回调、对象参数、布尔isSingleParameter、委托catchHandler)
位于System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调、对象参数、布尔isSingleParameter、委托catchHandler)
在System.Windows.Threading.DispatcherOperation.InvokeImpl()中
位于System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(对象状态)
位于System.Threading.ExecutionContext.runTryCode(对象用户数据)
在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码、CleanupCode backoutCode、Object userData)中运行
位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
在System.Windows.Threading.DispatcherOperation.Invoke()中
在System.Windows.Threading.Dispatcher.ProcessQueue()中
位于System.Windows.Threading.Dispatcher.WndProcHook(IntPtr-hwnd、Int32-msg、IntPtr-wParam、IntPtr-lParam、Boolean和handled)
在MS.Win32.HwndWrapper.WndProc(IntPtr-hwnd、Int32-msg、IntPtr-wParam、IntPtr-lParam、Boolean和handled)
在MS.Win32.HwndSubclass.DispatcherCallbackOperation(对象o)上
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(委托回调、对象参数、布尔isSingleParameter)
位于System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源、委托回调、对象参数、布尔isSingleParameter、委托catchHandler)
位于System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调、对象参数、布尔isSingleParameter、委托catchHandler)
位于System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority优先级、TimeSpan超时、委托方法、对象参数、布尔isSingleParameter)
位于System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority优先级、委托方法、对象参数)
位于MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd、Int32 msg、IntPtr wParam、IntPtr lParam)
位于MS.Win32.unsafentivemethods.DispatchMessage(MSG&MSG)
位于System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame框架)
在System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame框架)上
在System.Windows.Threading.Dispatcher.Run()中
位于System.Windows.Application.RunDispatcher(对象忽略)
位于System.Windows.Application.RunInternal(窗口)
在System.Windows.Application.Run(窗口)中
在System.Windows.Application.Run()处
在XamlGeneratedNamespace.GeneratedApplication.Main()处
位于System.AppDomain.\u nexecutestAssembly(程序集,字符串[]args)
位于System.AppDomain.nExecuteAssembly(程序集,字符串[]args)
at System.Runtime.Hosting.ManifestRunner.Run(布尔checkAptModel)
在System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()上
在System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext ActivationContext,String[]activationCustomData)中
位于System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext ActivationContext)
位于System.Activator.CreateInstance(ActivationContext ActivationContext)
位于Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()处
位于System.Threading.ThreadHelper.ThreadStart\u上下文(对象状态)
位于System.Threading.ExecutionContext.runTryCode(对象用户数据)
在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码、CleanupCode backoutCode、Object userData)中运行
位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)
位于System.Threading.ThreadHelper.ThreadStart()处
内部异常:
请查看我的更新评论。
刚刚又添加了一个编辑。查看您是否具有执行非托管代码的权限。。。如果没有,请授予它,然后重试 我想这将是一个你的规则因为某种原因被破坏的地方
Martin。您能否显示异常时正在运行的线程的代码?我可以看到正在显示/调用某个窗口,这是正确的WPF吗?由于某种原因,该窗口触发了权限异常…请同时输入该窗口的代码…我如何看到异常时运行的代码?我看到的是:单步执行:单步执行非用户代码“XamlGeneratedNamespace.GeneratedApplication.InitializeComponent”单步执行:单步执行非用户代码“XamlGeneratedNamespace.GeneratedApplication”