简体   繁体   中英

Visual studio is hanging when add a new dataset to RDLC report

I create a specific report.rdlc then i want to add new datatable to my report .

But after changing the data set ,trying to add new dataset to my report .

The visual studio is crashing every time and restart without adding the new dataset !

在此处输入图片说明

I search about this bug and According to Microsoft ,it says :

This is one of the oldest bugs in visual studio and it can easily crash "all versions" of visual studio (which is VS.nET 2015 update 1 right now). it happens when you move your project to another directory and report viewer component tries to open dataset schema from previous location. in order to fix this open rdlc file with a text editor. look for a property named "SchemaPath"and update the path of your dataset file there .


I did this suggestion ,then clean the project and rebuild it but the same problem ! How to fix this problem ?

<rd:DataSetInfo>
        <rd:DataSetName>AnalysisDS1</rd:DataSetName>
        <rd:SchemaPath>N:\ProjData\FinanceList\FinanceList\Finance\App_Code\AnalysisDS1.xsd</rd:SchemaPath>
        <rd:TableName>AnalysisDT1</rd:TableName>
        <rd:TableAdapterFillMethod />
        <rd:TableAdapterGetDataMethod />
        <rd:TableAdapterName />
</rd:DataSetInfo>

There's no fixing to this bug in VS until now, Hope Microsoft to fix this continuous problem .


The Workaround :

I Add a new fresh project to my solution ,then drag and drop my RDLC to my new project, then add a new data set ,finish my report and drag it again to its original project , and every thing goes okay .

I am also facing the same issue. To solve this problem there are two steps in my case those are given bellow:

1st: Open the the ' Event Viewer ' which is Default option of windows. In this 'Event Viewer' you will find out the actual reason to occurs this problem. 2nd: Uninstall the ' Crystal Report ' from the control panel.After uninstall the crystal report the problem is solved in my case.

This bug was a pain to solve but in our projects we had a couple of solutions and/or workaround for this.

Usually you will get 2 not so helpful messages in the event viewer like this

First Message:

Faulting application name: devenv.exe, version: 15.9.28307.423, time stamp: 0x5c5b5342 Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x49e07264 Faulting process id: 0x3e4c Faulting application start time: 0x01d5ab734dee5790 Faulting application path: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\devenv.exe Faulting module path: unknown Report Id: 93b01c49-4490-41a4-a8db-142f6a99697a Faulting package full name: Faulting package-relative application ID:

Second Message:

Application: devenv.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException at Microsoft.ReportDesigner.Design.ProjectItemUtil.GetComplexElements(System.Xml.Schema.XmlSchemaElement) at Microsoft.ReportDesigner.Design.DesignUtil.GetVenusObjectDataSources(System.Xml.Schema.XmlSchema[], System.IServiceProvider) at Microsoft.ReportDesigner.Data.Local.DataSetSynchronizer+d__11.MoveNext() at Microsoft.ReportDesigner.Data.Local.DataSetSynchronizer+d__7.MoveNext() at Microsoft.ReportDesigner.Data.Local.Dialogs.Pages.DataSetGeneralPage.LoadDataSources() at Microsoft.ReportDesigner.Data.Local.Dialogs.Pages.DataSetGeneralPage.LoadData() at Microsoft.ReportDesigner.Data.Local.Dialogs.DataSetDialog.OnLoad(System.EventArgs) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.ContainerControl.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Form.WmShowWindow(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef) at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

Solutions to resolve the issue:

  1. For some of us, it was a DLL reference that was the issue microsoft.office.sharepoint.tools.dll. So the process was to look at the DLLs that were added to TFS recently and try to remove them one by one from the project and try to add dataset again. That solved the issue for most of our team.

  2. Sometimes, Solution 1 is not enough, in my case I got the latest version from the fix from TFS but I was still having the issue. So the solution was to remove everything from the \\Project\\package\\ folder, save all and rebuild all. That solved the issue for me. So package was still there even if the reference was gone.

  3. This is a workaround but like people said here, you need to add a new project to your solution and create your rdlc report and dataset. This works fine but not so nice because you then need to copy your reports to the right Project after and change the content of .xsd (of the dataset) and the .rdlc file so that they point to the right path.

  4. This one is pretty obvious but you need to check if the path of the dataset, schema, db connection are all pointing to the right path in the .xsd and .rdlc file.

This was occurring for me in VS2017. I was able to fix the issue by first deleting everything in the /bin/ and /obj/ folders of the project where the .rdlc is contained.

Specifically it seems like there's FileIOException being thrown when opening the Dataset Properties window and it seems like one or both of these files in the /obj/ folder cannot be opened because they are being used by another process:

DesignTimeResolveAssemblyReferences.cache DesignTimeResolveAssemblyReferencesInput.cache

I wasn't able to figure out why sometimes the /bin/ needed to be cleared too, but better to be safe and just clear both.

Same issue happen for me. I just done following steps and works for me vs2015.

  1. Build=> Clean Solution in debug mode.
  2. Build=> Clean Solution in Release mode.

尝试删除 .vs 或 bin 和 obj 仍然不起作用,但是当我尝试删除我的数据源连接并添加新连接时,它对我有用。

Could this be linked with this other question ? vs 2019 crashes without any error report when opening solution

Repairing VS fixes the issue. Worth trying ;)

解决方案在这里...打开项目目录=>属性=>数据源并从此文件夹中删除所有文件...它有效

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM