[xsd-users] Managed code in generated header file

roee shlomo roee88 at gmail.com
Wed Apr 2 13:15:17 EDT 2008


Hi all,

I'm working on a project written in pure c++.

I'm using CodeSynthesis XSD and it used to work fine. It  generated a small
header file and all worked fine:

> ...
> // Begin prologue.
> //
> //
> // End prologue.
>
> #include <xsd/cxx/version.hxx>
>
> #if (XSD_INT_VERSION != 3000000L)
> #error XSD runtime version mismatch
> #endif
>
> #include <xsd/cxx/pre.hxx>
> ...
>

 I then upgraded from Microsoft Visual Studio 2005 Express to Microsoft
Visual Studio 2005 Professional and it doesn't work anymore.
Each time I build the project I can see:

> 1>Creating DataSet class using XSD ...
>
> 1>Writing file 'd:<censored>'.
>
And the header file generated by CodeSynthesis XSD changes into a large file
that uses .NET code:

>  #pragma once
>
> #using <mscorlib.dll>
> #using <System.dll>
> #using <System.Data.dll>
> #using <System.Xml.dll>
>
> using namespace System::Security::Permissions;
> [assembly:SecurityPermissionAttribute(SecurityAction::RequestMinimum,
> SkipVerification=false)];
> //
> // This source code was auto-generated by xsd, Version=2.0.50727.42.
> //
>
> ...
>
As a result I get this error in the generated file:

> fatal error C1190: managed targeted code requires a '/clr' option

 Note that I have set the appropriate values in `projects and solutions` ->
`vc++ directories`.
Thanks in advance,
Roee.



More information about the xsd-users mailing list