473,320 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Compilation error in class generated with XSD.exe

Hi

I am having problems generating classes from an xml schema using XSD.exe.

The schema in question is WiX.xsd (a Microsoft schema for WiX - a tool to
create MSIs). The xsd tool generates the classes but I get the following
compilation error:

----------------------------------------------------------
Snippet of generated code:

...
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://schemas.microsoft.com/wix/2003/01/wi"), _

System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://schemas.microsoft.com/wix/2003/01/wi", IsNullable:=false)> _
Public Class File

'<remarks/>
<System.Xml.Serialization.XmlAttributeAttribute( )> _
Public Id As String
....

----------------------------------------------------------
The error: Reference to a non-shared member requires an object reference
----------------------------------------------------------

The error is referencing ‘System’ in the line
‘<System.Xml.Serialization.XmlAttributeAttribute ()> _’.

Has anyone had this same problem when using XSD.exe? Any advice would be
greatly appreciated.

Many thanks.

Julia Beresford.

Nov 12 '05 #1
2 1631
Hi Julia,

I've had a fair amount of success with XSD.exe, although I have
occasionally had to edit the generated code afterwards. I copied your
code snippet into Visual Studio 2003, and it compiled fine, so that's
not enough to generate the error. I don't have WiX.xsd, so I can't run
XSD.exe on it to get the entire source file. Some things you might
want to try:

- Regenerate the source using C#, and see if it generates an error
message that is clearer.
- Add a Namespace to the generated code using the /n: switch on XSD.exe
- Just start simplifying the code by deleting pieces at a time until
the build error goes away.

Good luck.

Nov 12 '05 #2
Hi bert

Thanks for the resonse. I did as you suggested which was to compile to C#
and except 1 error (trying to serialize a 2-dimensional array, which I will
have to resolve somehow!!!) it compiled fine, so thanks for the suggestion.

Just for your information the compilation error I was getting in VB was only
for some of the classes being generated, which was weird. Also I was already
using the namespace switch.

Thanks again for the response.

Julia Beresford
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dennis Francis B. Tutanes | last post by:
$B$*@$OC$K$J$C$F$*$j$^$9!#(B $B%D%?%M%9(B@TSTI$B$G$9!#(B SEND-PR: -*- send-pr -*- SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as SEND-PR: will all comments (text...
6
by: Joachim | last post by:
I made some project changes (which seems it doesn't help if I undo) which have created compilation error: " Server Error in '/PCSWebApp1' Application....
0
by: James Zhuo | last post by:
hi all I changed the name of the class LoginPage to a different name "LoginPageOne" But the same error gets generated with the Wiliam.Request.LoginPageOne. That pretty much leaves me clueless...
5
by: Raterus | last post by:
I'm just throwing this error out for my sanity, I've seen posts about this, but never solutions. I'm using VS.NET 2003, Framework 1.1, and I'm getting a random error about every 1 out of 10 times...
2
by: VB Programmer | last post by:
I created a ASP.NET app locally and it works great. Uploaded it to my server and I get this error when trying to view a page. Any ideas? Server Error in '/earlyalert3' Application....
2
by: Kevin R. | last post by:
I have been ignoring this problem for a few weeks now, but it's becoming a bit annoying not to mention unproductive. Here it goes: I compile my project with no errors. Then after I debug/run it,...
0
by: z f | last post by:
i compile and test my vb.net asp.net web app. once in an hour or so i get a compilation error that only when i do IISRESET goes away. nothing related to my code. i compile and test on win XP...
0
by: Henry Jan | last post by:
Hi All, In VS2005, when I use compilation directive for namespace that contains a control Control1 class, e.g.: #if _Version_A_ namespace Component.Windows.ASuite #elif _Version_B_ ...
9
by: subramanian | last post by:
Hello. Consider the following code fragment : enum TestEnum { val1 = 10, val2 = 100, val3 = 1000 }; class Test { public : enum TestEnum { val1 = 1, val2 val3 }; Test(int i = 0, int j = 0,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.