Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vb.net(4.0 framework)表单未加载_Vb.net_Visual Studio 2010_.net 4.0_Crystal Reports 2010 - Fatal编程技术网

vb.net(4.0 framework)表单未加载

vb.net(4.0 framework)表单未加载,vb.net,visual-studio-2010,.net-4.0,crystal-reports-2010,Vb.net,Visual Studio 2010,.net 4.0,Crystal Reports 2010,希望有人能对这个问题有所启发 我在vb.net中有一个表单(使用VS2010、.net 4.0 framework),它不会加载,而是会在变量声明中出错。我的声明中有以下两行 Dim rpRBuilders As New rpRBuilder_2010.rp_RBuilder Public CR As New ReportDocument 现在,当我在每一行上放置断点时,它在第一行中断,但在处理“Public CR As New ReportDocument”并收到一般错误屏幕

希望有人能对这个问题有所启发

我在vb.net中有一个表单(使用VS2010、.net 4.0 framework),它不会加载,而是会在变量声明中出错。我的声明中有以下两行

    Dim rpRBuilders As New rpRBuilder_2010.rp_RBuilder
    Public CR As New ReportDocument
现在,当我在每一行上放置断点时,它在第一行中断,但在处理“Public CR As New ReportDocument”并收到一般错误屏幕时出错:

我已经下载并导入了VS2010的所有crystal report库,并且在我的项目中使用了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

提前感谢大家的帮助,如果需要,我可以提供更多细节

我写了一篇关于如何在VS2010中使用Crystal Reports和MS Access的指南:。我特别建议您确保未使用.net客户端框架,并将useLegacyV2RuntimeActivationPolicy添加到app.config文件中。最后,如果可能的话,您可能想使用SSRS:PHi bamie91,谢谢您的回复。不幸的是,正在放置UseLegacyv2运行时间。。。进入app.config文件对我不起作用,导致了我在原始帖子中描述的相同错误,并且SSRS不是一个选项,因为我们有大约400个使用CR构建的报告,更新到SSRS将花费太长时间。在进一步研究之后,我发现我的问题实际上与提供的任何内容无关。问题是我正在使用多个dll(内置),其中程序集信息中的COMVisible属性设置为false。我将此更改为true,然后必须为每个dll构建SNK文件。一旦每个dll被正确地签名,程序就不会出错。