希望有人能够对这个问题有所了解。
我在 vb.net 中有一个表单(使用 VS2010,.net 4.0 框架),它不会加载,而是在变量声明中出错。我的声明中有以下两行
Dim rpRBuilders As New rpRBuilder_2010.rp_RBuilder
Public CR As New ReportDocument
现在,当我在每一行上放置断点时,它会在第一行中断,但在处理“Public CR As New ReportDocument”时出错并收到一个通用错误屏幕:
我已经下载并导入了 VS2010 的所有水晶报表库,并在我的项目中使用 13.0.2000.0 版本。
提供的异常细节对我来说并不是特别有帮助,但你们中的一个人可能比我更能理解它:
System.InvalidOperationException was unhandled
Message=An error occurred creating the form. See Exception.InnerException for
details. The error is: Invalid ServicedComponent-derived classes were found in the
assembly.
(Classes must be public, concrete, have a public default constructor, and meet all
other ComVisibility requirements)
Source=ReportBuilder2010
StackTrace:
at ReportBuilder2010.My.MyProject.MyForms.Create__Instance__[T](T Instance) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at ReportBuilder2010.My.MyProject.MyForms.get_frmReports()
at ReportBuilder2010.frmReports.Main() in C:\To Back Up\Repository\Report Builder
2010\ReportBuilder2010\ReportBuilder2010\frmReports.Designer.vb:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.EnterpriseServices.RegistrationException
Message=Invalid ServicedComponent-derived classes were found in the assembly.
(Classes must be public, concrete, have a public default constructor, and meet all
other ComVisibility requirements)
Source=System.EnterpriseServices
StackTrace:
at System.EnterpriseServices.RegistrationThreadWrapper.PropInstallResult()
at
System.EnterpriseServices.RegistrationHelper.InstallAssemblyFromConfig
(RegistrationConfig& regConfig)
at System.EnterpriseServices.RegistrationHelper.InstallAssembly(String
assembly, String& application, String partition, String& tlb, InstallationFlags
installFlags)
at System.EnterpriseServices.RegistrationHelper.System.EnterpriseServices.
Thunk.IThunkInstallation.DefaultInstall(String asm)
at System.EnterpriseServices.Thunk.Proxy.RegisterAssembly(Assembly assembly)
at System.EnterpriseServices.Thunk.Proxy.LazyRegister(Guid id, Type
serverType, Boolean checkCache)
at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType,
Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
at System.EnterpriseServices.ServicedComponentProxyAttribute.
CreateInstance(Type serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK
(RuntimeType serverType, Object[] props, Boolean bNewObj)
at ReportBuilder2010.frmReports..ctor() in C:\To Back Up\Repository\Report
Builder 2010\ReportBuilder2010\ReportBuilder2010\frmReports.vb:line 27
提前感谢大家的帮助,如果需要,我可以提供更多详细信息。