Typed Dataset not using TypedTableBase in .NET 4

后端 未结 3 549
面向向阳花
面向向阳花 2020-12-21 02:20

I\'m migrating our DAL class library to .NET 4 (from .NET 3.5). We\'re using typed datasets quite often, and we often iterate over tables:

foreach(var row in         


        
3条回答
  •  隐瞒了意图╮
    2020-12-21 02:53

    The accepted answer is mostly complete, but will not fully resolve the issue.
    Here's a reproduction of my question and answer on this issue.

    The Problem:

    In short, the problem occurs when the MSDataSetGenerator tool runs, but the System.Data.DataSetExtensions assembly has not yet been loaded into the current Visual Studio process.

    The Solution:

    One way to load the assembly is just to open any XSD file and THEN re-generate the designer code.

    The following steps should generate the appropriate designer file:

    1. Open any XSD file to the designer view (this loads DataSetExtensions.dll)
    2. Right Click on the XSD and Select Run Custom Tool

    Here's a full step by step walkthrough of the issue and solution with pictures

    Other Instances:

    This problem has also been reported to Microsoft in the following bug tickets:

    • #668724 - MSDataSetGenerator generates incorrect output sometimes
    • #733077 - MSDataSetGenerator does not generate TypedTableBase derived classes

提交回复
热议问题