在asp.net中,一个解决方案中用个Web应用程序项目调用一个类项目,已经添加了引用,也已经引入类文件,但还总是出错:“/sp1020”应用程序中的服务器错误。
--------------------------------------------------------------------------------对注册表项 HKEY_CLASSES_ROOT\SinoPac.IDSequence 的访问被拒绝。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.UnauthorizedAccessException: 对注册表项 HKEY_CLASSES_ROOT\SinoPac.IDSequence 的访问被拒绝。 ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。ASP.NET 有一个在应用程序没有模拟时使用的基进程标识(通常,在 IIS 5 上为 {MACHINE}\ASPNET,在 IIS 6 上为网络服务)。如果应用程序正在通过 <identity impersonate="true"/> 模拟,则标识将为匿名用户(通常为 IUSR_MACHINENAME)或经过身份验证的请求用户。 若要授予 ASP.NET 对文件的写访问权,请在资源管理器中右击该文件,选择“属性”,然后选择“安全”选项卡。单击“添加”添加适当的用户或组。突出显示 ASP.NET 帐户,选中所需访问权限对应的框。源错误: 
行 59:     Private Sub cmdSave_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.ServerClick
行 60:         '**********获得personID***************
行 61:         Dim LOBJ_GetId As SinoPac.IDSequence = New SinoPac.IDSequence
行 62:         Dim LSTR_PersonID As String = LOBJ_GetId.GetID("SP1020", "11")
行 63: 
 源文件: E:\work\frmsp1020.aspx.vb    行: 61 堆栈跟踪: 
[UnauthorizedAccessException: 对注册表项 HKEY_CLASSES_ROOT\SinoPac.IDSequence 的访问被拒绝。]
   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)[RegistrationException: 无法注册程序集“IDSequence, Version=1.0.0.0, Culture=neutral, PublicKeyToken=453d43a2123ee092”。]
   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)
   System.EnterpriseServices.RegistrationHelper.TryTransactedInstall(RegistrationConfig regConfig)
   System.EnterpriseServices.RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig& regConfig)
   System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly, String& application, String partition, String& tlb, InstallationFlags installFlags)
   System.EnterpriseServices.RegistrationHelper.InstallAssembly(String assembly, String& application, String& tlb, InstallationFlags installFlags)
   System.EnterpriseServices.RegistrationHelper.System.EnterpriseServices.Thunk.IThunkInstallation.DefaultInstall(String asm)
   System.EnterpriseServices.Thunk.Proxy.RegisterAssembly(Assembly assembly)
   System.EnterpriseServices.Thunk.Proxy.LazyRegister(Guid id, Type serverType, Boolean checkCache)
   System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
   System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)
   System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(Type serverType, Object[] props, Boolean bNewObj) +74
   SP1020.frmsp1020.cmdSave_ServerClick(Object sender, EventArgs e) in E:\work\frmsp1020.aspx.vb:61
   System.Web.UI.HtmlControls.HtmlButton.OnServerClick(EventArgs e)
   System.Web.UI.HtmlControls.HtmlButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain() 
请哪位高手出来指点一番!!

解决方案 »

  1.   

    不是说得很清楚了么/权限不够..若要授予 ASP.NET 对文件的写访问权,请在资源管理器中右击该文件,选择“属性”,然后选择“安全”选项卡。单击“添加”添加适当的用户或组。突出显示 ASP.NET 帐户,选中所需访问权限对应的框。
      

  2.   

    看看以前的帖子,有好多这个问题!自己找找吧,还有google