PC Review


Reply
Thread Tools Rate Thread

Code Gen tool and the InitializeComponent() method

 
 
moondaddy
Guest
Posts: n/a
 
      7th Feb 2008
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.

--
(E-Mail Removed)am


 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      8th Feb 2008
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
moondaddy
Guest
Posts: n/a
 
      12th Feb 2008
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.



""Walter Wang [MSFT]"" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ((E-Mail Removed), 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.
>



 
Reply With Quote
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      17th Feb 2008
Thanks for the follow-up.


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


Regards,
Walter Wang ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a method in InitializeComponent() using codedom from userc Devasena Microsoft C# .NET 0 29th Mar 2010 01:46 PM
How to generate code in Form_Load method. NOT in InitializeComponent() JacksonYin Microsoft C# .NET 1 30th Nov 2005 09:50 AM
Failed to parse method 'InitializeComponent' =?Utf-8?B?V2hpc2t5Um9tZW8=?= Microsoft Dot NET Framework Forms 1 5th Aug 2005 04:38 PM
user control, which way is better and How InitializeComponent() {} is generated? What to do if I need change code in InitializeComponent(){}? Ryan Liu Microsoft C# .NET 0 14th Nov 2004 03:19 PM
user control, which way is better and How InitializeComponent() {} is generated? What to do if I need change code in InitializeComponent(){}? Ryan Liu Microsoft Dot NET 0 14th Nov 2004 03:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:02 PM.