Code Gen tool and the InitializeComponent() method

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I'm made a RAD code generation tool that (among many other things) makes WPF
UserControls. It creates all the XAML and codebehind just fine (i.e.:
mycontrol.xaml and mycontrol.xaml.cs)

However, I also need to generate the mycontrol.g.cs file which will be
located in the obj/Debug folder.

The biggest obstacle in creating this file is the first line of code in it
which is something like this:


#pragma checksum "..\..\mycontrol.xaml"
"{406ea660-64cf-4c82-b6f0-42d48172a799}" "4809B608A4C9A3D0764E1AD5BFEDE59A"

Is there an API I can call to create this file. What options do I have
other than going into VS and manually creating the user control by the
correct name, and then coping all of my code-gen code into it? I will have
100s of user controls and don't want to do this manually as it goes against
to reason for having code gen tools.

Thanks.
 
Hi moondaddy,

Why do you need to generate those files? Based on my understanding, the
entire bin and obj subfolders can be recreated Visual Studio, which means
those .g.cs files are also generated by Visual Studio while building.

While you can find the documentation of the "#pragma checksum" here:
http://msdn2.microsoft.com/en-us/library/ms173226.aspx, there's no official
documentation on the .g.cs files in WPF.



Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
OK I'm going to look into this. I was having some troubles when brining a
code-gen xaml and xaml.cs file into a project compared to having VS create
them.
 
Thanks for the follow-up.


Please feel free to let me know if there's any update on this issue.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top