By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,666 Members | 1,544 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,666 IT Pros & Developers. It's quick & easy.

Generate class from schema (VS.NET 2005)

P: n/a
I'm sure this is possible but I just can't see how to do it. I want to add
schemas to my solution and have C# classes automatically generated from
them. I can see how to generate typed DataSet's with the MSDataSetGenerator
custom tool. Is there something similar for simple schemas?

Regards
Phil Lee
Nov 23 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Hi Phil,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Nov 23 '05 #2

P: n/a
Hi Phil,

Welcome to webservice newsgroup.
Regarding on the Auto code generating from XSD file in VS.NET 2005, there
hasn't build-in Custom Tool for this. Currently the available ones is
still the DataSet generator and WSDL proxy generator. For custom class
generating from xml schema, we can still use the Xsd.exe provided by
VS.NET 2.0 sdk like we do in vs.net 2003/.net 1.x.... You can run the
xsd.exe from VS.NET 2005 command prompt window.... In addition, in VS.NET
2003, there has a external custom tool addin(XsdClassesGen ) writen by
Chris Cells:

http://www.sellsbrothers.com/tools/#xsdClassesGen

For .net 2.0/VS.NET 2005 since it has just been released, I think it may
take some further time to have such a new verion available.

Thanks for your understanding.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: "Phil Lee" <ph******@newsgroups.nospam>
Subject: Generate class from schema (VS.NET 2005)
Date: Fri, 4 Nov 2005 18:52:54 -0000
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uv**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-79-96.range86-132.btcentralplus.com
86.132.79.96
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
microsoft.public.dotnet.framework.webservices:8476
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I'm sure this is possible but I just can't see how to do it. I want to add
schemas to my solution and have C# classes automatically generated from
them. I can see how to generate typed DataSet's with the
MSDataSetGenerator
custom tool. Is there something similar for simple schemas?

Regards
Phil Lee

Nov 23 '05 #3

P: n/a
Phil, I've ran into this problem just last week. One way to deal with it is
to use your Build Events under int the configuration for you VS (both 2003
and 2005) project. On your pre-build event command line, you can execute the
XSD.exe on any file you choose before you build. This is more difficult to
maintain than having a custom-tool, but it'll get the job done.

Hope this helps,
Cordell Lawrence
Teleios Systems Ltd.

"Phil Lee" <ph******@newsgroups.nospam> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...
I'm sure this is possible but I just can't see how to do it. I want to
add schemas to my solution and have C# classes automatically generated
from them. I can see how to generate typed DataSet's with the
MSDataSetGenerator custom tool. Is there something similar for simple
schemas?

Regards
Phil Lee

Nov 23 '05 #4

P: n/a
Hi Phil,

How are you doing on this thread, does the info provided in my last reply
helps a little?
If there're anything else we can help, please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
X-Tomcat-ID: 186537628
References: <uv**************@TK2MSFTNGP09.phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_7E1F845E"
Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Sun, 06 Nov 2005 07:54:17 GMT
Subject: RE: Generate class from schema (VS.NET 2005)
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <AS**************@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 119
Path: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8505
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Phil,

Welcome to webservice newsgroup.
Regarding on the Auto code generating from XSD file in VS.NET 2005, there
hasn't build-in Custom Tool for this. Currently the available ones is
still the DataSet generator and WSDL proxy generator. For custom class
generating from xml schema, we can still use the Xsd.exe provided by
VS.NET 2.0 sdk like we do in vs.net 2003/.net 1.x.... You can run the
xsd.exe from VS.NET 2005 command prompt window.... In addition, in VS.NET
2003, there has a external custom tool addin(XsdClassesGen ) writen by
Chris Cells:

http://www.sellsbrothers.com/tools/#xsdClassesGen

For .net 2.0/VS.NET 2005 since it has just been released, I think it may
take some further time to have such a new verion available.

Thanks for your understanding.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: "Phil Lee" <ph******@newsgroups.nospam>
Subject: Generate class from schema (VS.NET 2005)
Date: Fri, 4 Nov 2005 18:52:54 -0000
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uv**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-79-96.range86-132.btcentralplus.com
86.132.79.96
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
microsoft.public.dotnet.framework.webservices:8476
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I'm sure this is possible but I just can't see how to do it. I want to add
schemas to my solution and have C# classes automatically generated from
them. I can see how to generate typed DataSet's with the
MSDataSetGenerator
custom tool. Is there something similar for simple schemas?

Regards
Phil Lee

Nov 23 '05 #5

P: n/a
Steven,

thanks for the help. I have decided to just manually generate the classes
using xsd.exe, or perhaps put in a build event as suggested by Cordell
Lawrence.

Regards
Phil Lee
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:BZ**************@TK2MSFTNGXA02.phx.gbl...
Hi Phil,

How are you doing on this thread, does the info provided in my last reply
helps a little?
If there're anything else we can help, please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
X-Tomcat-ID: 186537628
References: <uv**************@TK2MSFTNGP09.phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_0001_7E1F845E"
Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Sun, 06 Nov 2005 07:54:17 GMT
Subject: RE: Generate class from schema (VS.NET 2005)
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <AS**************@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 119
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8505
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Phil,

Welcome to webservice newsgroup.
Regarding on the Auto code generating from XSD file in VS.NET 2005, there
hasn't build-in Custom Tool for this. Currently the available ones is
still the DataSet generator and WSDL proxy generator. For custom class
generating from xml schema, we can still use the Xsd.exe provided by
VS.NET 2.0 sdk like we do in vs.net 2003/.net 1.x.... You can run the
xsd.exe from VS.NET 2005 command prompt window.... In addition, in
VS.NET
2003, there has a external custom tool addin(XsdClassesGen ) writen by
Chris Cells:

http://www.sellsbrothers.com/tools/#xsdClassesGen

For .net 2.0/VS.NET 2005 since it has just been released, I think it may
take some further time to have such a new verion available.

Thanks for your understanding.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: "Phil Lee" <ph******@newsgroups.nospam>
Subject: Generate class from schema (VS.NET 2005)
Date: Fri, 4 Nov 2005 18:52:54 -0000
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uv**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-79-96.range86-132.btcentralplus.com
86.132.79.96
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8476
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I'm sure this is possible but I just can't see how to do it. I want to
add
schemas to my solution and have C# classes automatically generated from
them. I can see how to generate typed DataSet's with the
MSDataSetGenerator
custom tool. Is there something similar for simple schemas?

Regards
Phil Lee


Nov 23 '05 #6

P: n/a
Thanks for your followup, Lawrence.

And please feel free to post here when you need any further help.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: "Phil Lee" <ph******@newsgroups.nospam>
References: <uv**************@TK2MSFTNGP09.phx.gbl>
<AS**************@TK2MSFTNGXA01.phx.gbl>
<BZ**************@TK2MSFTNGXA02.phx.gbl>
Subject: Re: Generate class from schema (VS.NET 2005)
Date: Mon, 14 Nov 2005 09:17:59 -0000
Lines: 111
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <u6**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-84-190.range86-132.btcentralplus.com
86.132.84.190
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
microsoft.public.dotnet.framework.webservices:1271 0
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Steven,

thanks for the help. I have decided to just manually generate the classes
using xsd.exe, or perhaps put in a build event as suggested by Cordell
Lawrence.

Regards
Phil Lee
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:BZ**************@TK2MSFTNGXA02.phx.gbl...
Hi Phil,

How are you doing on this thread, does the info provided in my last reply
helps a little?
If there're anything else we can help, please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
X-Tomcat-ID: 186537628
References: <uv**************@TK2MSFTNGP09.phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_0001_7E1F845E"
Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Sun, 06 Nov 2005 07:54:17 GMT
Subject: RE: Generate class from schema (VS.NET 2005)
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <AS**************@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 119
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8505
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Phil,

Welcome to webservice newsgroup.
Regarding on the Auto code generating from XSD file in VS.NET 2005, there
hasn't build-in Custom Tool for this. Currently the available ones is
still the DataSet generator and WSDL proxy generator. For custom class
generating from xml schema, we can still use the Xsd.exe provided by
VS.NET 2.0 sdk like we do in vs.net 2003/.net 1.x.... You can run the
xsd.exe from VS.NET 2005 command prompt window.... In addition, in
VS.NET
2003, there has a external custom tool addin(XsdClassesGen ) writen by
Chris Cells:

http://www.sellsbrothers.com/tools/#xsdClassesGen

For .net 2.0/VS.NET 2005 since it has just been released, I think it may
take some further time to have such a new verion available.

Thanks for your understanding.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
From: "Phil Lee" <ph******@newsgroups.nospam>
Subject: Generate class from schema (VS.NET 2005)
Date: Fri, 4 Nov 2005 18:52:54 -0000
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uv**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: host86-132-79-96.range86-132.btcentralplus.com
86.132.79.96
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8476
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I'm sure this is possible but I just can't see how to do it. I want to
add
schemas to my solution and have C# classes automatically generated from
them. I can see how to generate typed DataSet's with the
MSDataSetGenerator
custom tool. Is there something similar for simple schemas?

Regards
Phil Lee



Nov 23 '05 #7

P: n/a
Phil,

This might be of interest to you. Aaron Skonnard wrote a
System.Web.Compilation.BuildProvider implementation that monitors
changes to your *.xsd files and generates the code for them. This
obviously is only for Web projects. Go here
http://pluralsight.com/blogs/aaron/a.../13/14794.aspx and
follow the link to the demos. Look in that *.zip file for
XsdBuildProvider to get started.

HTH.

Cheers,
Dan Mork

Nov 23 '05 #8

P: n/a
Phil,

This is more what you're looking for:
http://www.sellsbrothers.com/tools/#xsdClassesGen

Cheers,
Dan Mork

Nov 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.