Could you support TypedDataSets in MSBee?

Topics: For MSBee Developers
Aug 16, 2006 at 11:26 PM
migrated from power toy forums
originally posted by OlegAA
------------------------------------------------------

Thank MSBee team for usefull tool!

Could you add support for typed datasets in MSBee?

MSDatasetGenerator is different in .Net 2.0

Typed datasets is used in every our project.

Or maybe you may suggest temporary workaround on typed datasets in projects for building by "MSBee and MSBuild"?

Thanks in advance!

Oleg
Aug 16, 2006 at 11:26 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

This is an interesting idea although I don't know if we'll get around to it. I think our best bet is for you to add this suggestion in BugTracker on the MSBee home page. This will allow you, along with other project members, to track the status of your suggestion. Additionally, it allows us to keep track of it so if we do have time, we won't forget about it.

To do this, go to http://go.microsoft.com/fwlink/?LinkId=59384 and click on the "Bug Tracker" link on the left pane. This will take you to the BugTracker home page for MSBee. If you click on the "Manage bug" link in the left pane, you can add a new bug to the MSBee bug tracker.

If you get an error that your request can't be processed, then that means you need to become a project member. In that case, you can go back to the MSBee project homepage and click on "Apply to join this project" link on the right. Once you've become a project member, try submitting the suggestion again.

As for a workaround, your best bet may be to use the Exec task to manually invoke xsd.exe when you need to. Note that xsd.exe is part of the .NET 1.1 SDK (although you should have that installed since it's a requirement for MSBee).

Another thing to check out are the ".NET SDC MSBuild Tasks". This is a collection of MSBuild tasks that provide additional functionality. Maybe they have a task which handles typed datasets and can be retargeted for .NET 1.1.
Aug 16, 2006 at 11:27 PM
originally posted by OlegAA
------------------------------------------------------


Thank Craig!

I added suggestion "000006" in MSBee "Bug Tracker".

Looking on "Exec task", did not find suitable task in ".NET SDC MSBuild Tasks".
Aug 16, 2006 at 11:27 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

After reviewing your suggestion in BugTracker, I wondering if I misunderstood your request. It seems like you hit a project conversion issue. For those who haven't seen the bug, I've copied the description below:

Create a sample WinForms application with simple typed dataset. Open it in Visual Studio 2005. Typed dataset is converted for .Net 2.0 and MSDataSetGenerator 2.0
Try to build project by MSBee.

There are following errors in "section" "Target CoreCompile:":

C:\Projects\Local\WindowsApplication1\StatInfo.Designer.vb(24): error BC3203
5: Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.
C:\Projects\Local\WindowsApplication1\StatInfo.Designer.vb(25): error BC3000
1: Statement is not valid in a namespace.
... and others

I have little experience generating TypedDataSets so I'm wondering:

1. Are you generating your dataset using xsd.exe or are you doing it programmatically?

2. Am I correct that you built the original app in VS 2003 and then converted it in 2005? Assuming that's the case, maybe you could remove the compiler errors by using the FX1_1 constant to ifdef your code. See this thread for an example
Aug 16, 2006 at 11:27 PM
originally posted by Craig Lichtenstein - MSFT
-----------------------------------------------------

Any follow-up here? If I don't hear back in the next week, I'm going to consider the problem closed and close this thread.
Aug 16, 2006 at 11:27 PM
originally posted by Jazzy
------------------------------------------------------

After taking a quick look at this, the Visual Studio 2005 IDE changes the code file from being a standard class into a partial class. So in order to get the original file back you have to call the XSD.exe for .NET 1.1.
Aug 16, 2006 at 11:31 PM
originally posted by Craig Lichtenstein - MSFT
------------------------------------------------------

Unfortunately, MSBee can't have control over the project conversion process, hence the issues with partial classes and .NET 2.0 only attributes that need to be manually changed for .NET 1.1 compatibility.
Aug 16, 2006 at 11:31 PM
originally posted by Torsten Pietrek
------------------------------------------------------

The workaround for using .net 1.1 compatible typed datasets in VS2005 I use is:

Design the datset (say MyDS) in VS2003, then copy the autogenerated file (MyDS.cs) from the VS2003 project folder to the VS2005 project folder and add the file to the VS2005 project as an existing item.

This makes the MyDS dataset class, subclasses etc. fully available in VS2005.

Regards, Torsten
Aug 16, 2006 at 11:31 PM
originally posted by Jazzy
------------------------------------------------------

Once we get the 1.0 release out in the public, I would love to see about doing something with Visual Studio that would help call the correct 1.1 tools when MSBee is attached to the project. Maybe there is something that can be done as a plugin to the IDE or as an additional component of MSBee.
Aug 16, 2006 at 11:32 PM
originally posted by Evgeny Popov
------------------------------------------------------

I got the same problem... There is also problem with generating Web Service References. May be the right way is to write new MSDataSetGenerator_11 and use a newly one instead of MSDataSetGenerator for .NET 2.0 when you need it. What do you think?
Aug 16, 2006 at 11:32 PM
originally posted by Bertan Aygun - MSFT
------------------------------------------------------

If there is an executable generating code for typed data sets in Visual Studio 2003, a custom tool for Visual Studio 2005 can be implemented using that executable and typed data set files' custom tool property can be changed to use the new tool.
Aug 16, 2006 at 11:32 PM
originally posted by Evgeny Popov
------------------------------------------------------

This is a code which does it well. I can send whole project on demand. The same way could be WSDL generation done I guess.

ComVisible(true)

Guid("9AA62C67-C305-400c-BC09-CDCB6DC73776")

CodeGeneratorRegistration(typeof(MSDataSetCodeGenerator), "C

CodeGeneratorRegistration(typeof(MSDataSetCodeGenerator), "VB Code Generator for XSD with .Net 1.1 support", vsContextGuids.vsContextGuidVBProject, GeneratesDesignTimeSource = true)

CodeGeneratorRegistration(typeof(MSDataSetCodeGenerator), "J

ProvideObject(typeof(MSDataSetCodeGenerator))

public class MSDataSetCodeGenerator : BaseCodeGeneratorWithSite

{

//The name of this generator (use for 'Custom Tool' property of project item)

internal static string name = "MSDataSetCodeGenerator11";

/// <summary>

/// Function that builds the contents of the generated file based on the contents of the input file

/// </summary>

/// <param name="inputFileContent">Content of the input file</param>

/// <returns>Generated file as a byte array</returns>

protected override byte[] GenerateCode(string inputFileContent)

{

CodeDomProvider provider = GetCodeProvider();


try

{

StringBuilder sb = new StringBuilder();

StringWriter writer = new StringWriter(sb);

ICodeGenerator codeGen = provider.CreateGenerator(writer);

string text7 = string.Empty;

//this.CreateCodeGenerator(text1, ref codeGen, ref text7);

DataSet set1 = new DataSet();

set1.ReadXmlSchema(new System.IO.StringReader(inputFileContent));


Xsd.GenerateDataSetClasses(set1, base.FileNameSpace, writer, codeGen);

System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();

return encoding.GetBytes(sb.ToString());

}

catch (Exception e)

{

this.GeneratorError(4, e.ToString(), 1, 1);

//Returning null signifies that generation has failed

return null;

}

}

}
Aug 16, 2006 at 11:32 PM
originally posted by Bertan Aygun - MSFT
------------------------------------------------------

Evgeny,

Thanks for the help, would you be willing to contribute this custom tool directly to MSBee project?

Thanks,

Bertan
Aug 16, 2006 at 11:32 PM
originally posted by Evgeny Popov
------------------------------------------------------

I could do it. But I was playing with new tool and found some problem. So I guess I need to fix them before posting this tool to MSBee project. By the way, what is a way to do it?

Evgeny
Aug 16, 2006 at 11:33 PM
originally posted by Bertan Aygun - MSFT
------------------------------------------------------

You can find out how to contribute to MSBee on Codeplex project page:

http://www.codeplex.com/Wiki/View.aspx?ProjectName=MSBee

There is a section called "Contributing to MSBee" that explains the process.
Aug 16, 2006 at 11:33 PM
originally posted by Evgeny Popov
------------------------------------------------------

I have submited two features for MSBee project. The first one is about supporting J# and the second one is about TypedDataset. These issues contain attachments with a code.