“/WebExam”应用程序中的服务器错误。
--------------------------------------------------------------------------------对注册表项 HKEY_CLASSES_ROOT\NoPaperExam.Security 的访问被拒绝。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.UnauthorizedAccessException: 对注册表项 HKEY_CLASSES_ROOT\NoPaperExam.Security 的访问被拒绝。 ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。ASP.NET 有一个在应用程序没有模拟时使用的基进程标识(通常,在 IIS 5 上为 {MACHINE}\ASPNET,在 IIS 6 上为网络服务)。如果应用程序正在通过 <identity impersonate="true"/> 模拟,则标识将为匿名用户(通常为 IUSR_MACHINENAME)或经过身份验证的请求用户。 若要授予 ASP.NET 对文件的写访问权,请在资源管理器中右击该文件,选择“属性”,然后选择“安全”选项卡。单击“添加”添加适当的用户或组。突出显示 ASP.NET 帐户,选中所需访问权限对应的框。源错误: 
行 33: 
行 34:     Private Sub login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles login.Click
行 35:         Dim mySec As NoPaperExam.Security = New NoPaperExam.Security
行 36:         Dim iResult As Int32
行 37:         iResult = mySec.CheckPwd(Username1.Text, Password1.Text)
 源文件: E:\IIS网站\WebExam\Login.aspx.vb    行: 35 堆栈跟踪: 
[UnauthorizedAccessException: 对注册表项 HKEY_CLASSES_ROOT\NoPaperExam.Security 的访问被拒绝。]
   Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) +74
   Microsoft.Win32.RegistryKey.CreateSubKey(String subkey) +503
   System.Runtime.InteropServices.RegistrationServices.RegisterManagedType(Type type, String strAsmName, String strAsmVersion, String strAsmCodeBase, String strRuntimeVersion) +213
   System.Runtime.InteropServices.RegistrationServices.RegisterAssembly(Assembly assembly, AssemblyRegistrationFlags flags) +261
   System.EnterpriseServices.RegistrationDriver.ClassicRegistration(Assembly asm) +100[RegistrationException: 无法注册程序集“NoPaperExam, Version=1.0.1980.18459, Culture=neutral, PublicKeyToken=5d5e1b3c61ed5906”。]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +264
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +877
   System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync) +0
   System.EnterpriseServices.RegistrationHelper.TryTransactedInstall(RegistrationConfig regConfig) +214
   System.EnterpriseServices.RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig& regConfig) +241
   System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly, String& application, String partition, String& tlb, InstallationFlags installFlags) +116
   System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly, String& application, String& tlb, InstallationFlags installFlags) +19
   System.EnterpriseServices.RegistrationHelper.System.EnterpriseServices.Thunk.IThunkInstallation.DefaultInstall(String asm) +43
   System.EnterpriseServices.Thunk.Proxy.RegisterAssembly(Assembly assembly) +95
   System.EnterpriseServices.Thunk.Proxy.LazyRegister(Guid id, Type serverType, Boolean checkCache) +188
   System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri) +227
   System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType) +181
   System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj) +74
   WebExams.WebForm1.login_Click(Object sender, EventArgs e) in E:\IIS网站\WebExam\Login.aspx.vb:35
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573

解决方案 »

  1.   

    好象跟用户权限有关,,,再查查这个方面的资料;用www.google.com
      

  2.   

    NoPaperExam.Security 是否是一DLL文件。检查项目中是否未添加对NoPaperExam的引用。如没有引用进来编译。
      

  3.   

    服务器的设置,和程序没什么关系。
    你的程序要求访问注册表,如果是你自己的机器,给WPG_IIS这个组的用户以注册表访问权,如果还不行就再给ASPNET,不过不太安全,注意。如果是租用的空间,基本上来说不会允许你做这样的操作,你问问空间提供商是否愿意开后门。
      

  4.   

    应该是用户权限问题,修改machine.config文件,将processModel段的userName="machine"换成userName="system"试试。