WSSF:ME VS2008 and debugging code generation...

Topics: Service Factory Modeling Edition Forum
May 5, 2008 at 9:42 PM
How do you debug the code generation? I'm working on converting the templates to generate VB.Net code based on http://www.codeplex.com/servicefactory/Thread/View.aspx?ThreadId=23840. However, the projects are not generating the code. I tried attaching to the IDE process while generating the code, but having no luck.

Any suggestions?
Developer
May 6, 2008 at 5:40 PM
Did you try this?
http://blogs.msdn.com/tomholl/archive/2006/08/27/727740.aspx
May 15, 2008 at 7:35 PM
Sorry for the late response.  The link was helpful.  However, I can't find where I can set a breakpoint within the source.  I monitored the call stack, but the call stack points to external projects that I don't have source for (including debug symbols).  Any suggestions on where to begin?

charlyfriend wrote:
Did you try this?
http://blogs.msdn.com/tomholl/archive/2006/08/27/727740.aspx



May 15, 2008 at 7:43 PM
Sorry for the late response.  The link was helpful.  However, I can't find where I can set a breakpoint within the source.  I monitored the call stack, but the call stack points to external projects that I don't have source for (including debug symbols).  Any suggestions on where to begin?

charlyfriend wrote:
Did you try this?
http://blogs.msdn.com/tomholl/archive/2006/08/27/727740.aspx



May 15, 2008 at 9:14 PM
When debugging, am I suppose to debug while registering the Service Factory Guidance Package?

remkm01 wrote:
Sorry for the late response.  The link was helpful.  However, I can't find where I can set a breakpoint within the source.  I monitored the call stack, but the call stack points to external projects that I don't have source for (including debug symbols).  Any suggestions on where to begin?

charlyfriend wrote:
Did you try this?
http://blogs.msdn.com/tomholl/archive/2006/08/27/727740.aspx






Developer
May 15, 2008 at 11:03 PM
You first need to register the factory. Then you ran a new instance of VS in the Experimantal Hive, you create a new sln and after that you can attach your factory VS instance to the new sln instance.
That way you may debug the factory and code generation.
May 15, 2008 at 11:33 PM
Ok...  This is what I did...

1. Changed the TextTemplates, Built and registered the factory.
2. Opened VS using the Experimantal Hive and created a partial project from the HOL (Created a service, operation, and data contracts) - Didn't build the implementation projects yet...
3. Closed the project in step 2.
4. Opened the Factory Solution and configured it as described in http://blogs.msdn.com/tomholl/archive/2006/08/27/727740.aspx.  (Pointed to the project in step 2 with the experimental hive switches.)
5. Started the debug, which opened project in step 2, and created the WCF implementation.

Am I doing this correctly, so far?


charlyfriend wrote:
You first need to register the factory. Then you ran a new instance of VS in the Experimantal Hive, you create a new sln and after that you can attach your factory VS instance to the new sln instance.
That way you may debug the factory and code generation.


Developer
May 15, 2008 at 11:40 PM
You can simple do #1 and #2 and the attach #1 VS to #2 VS and debug.
In case you follow the link description, then you can avoid #2 and #3.
May 16, 2008 at 1:00 AM

Thanks.  Now the important question... Where do I set the breakpoint?  I spent 2-3 hours of setting breakpoints today and the only breakpoints that I could hit is at the end of creating the implementation projects.

When does the code generation happen?  When each project is created or at the end?


charlyfriend wrote:
You can simple do #1 and #2 and the attach #1 VS to #2 VS and debug.
In case you follow the link description, then you can avoid #2 and #3.


Developer
May 16, 2008 at 2:08 AM
There are several places.
You can add some bkps in the CodeGeneration.Strategies library, (look for TextTemplateCodeGenerationStrategy class)
May 16, 2008 at 6:39 PM
Thanks for getting back to me.  I did what you suggested.  However, I'm not having any luck on the bkps you suggested.  I just want to clarify what I did was correct...

In "Microsoft.Practices.Modeling.CodeGeneration.Strategies" project, I set bkps on all properties and methods for all classes in this project (I know this is overkill), but no bkps are hit.

I know that I'm attached because I get this output from the Factory Debug window...

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

The thread 0x178c has exited with code 0 (0x0).

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll

A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll

A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Web.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

devenv.exe Information: 0 : Starting execution of recipe CreateWCFService.

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

devenv.exe Information: 0 : Execution result was Suspend

devenv.exe Information: 0 : ------------------------------------------------------------------------------------------------------------------------------------------------------

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.VSDesigner.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Practices.VisualStudio.Library.dll

devenv.exe Information: 0 : Starting execution of recipe CreateWCFService.

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

A first chance exception of type 'Microsoft.Practices.RecipeFramework.GuidancePackage.ArgumentDoesntExistException' occurred in Microsoft.Practices.RecipeFramework.dll

'devenv.exe' (Managed): Loaded 'hz8sbzwz'

'devenv.exe' (Managed): Loaded '4krbcqtl'

'devenv.exe' (Managed): Loaded '23vzrm65'

'devenv.exe' (Managed): Loaded 'blwoz76j'

'devenv.exe' (Managed): Loaded 'qm_rcls4'

'devenv.exe' (Managed): Loaded 'r7ucqi2o'

'devenv.exe' (Managed): Loaded 'sivyd2ct'

'devenv.exe' (Managed): Loaded '9o5kyxwc'

'devenv.exe' (Managed): Loaded 'vfjbhcuv'

'devenv.exe' (Managed): Loaded 'stm9vzlq'

'devenv.exe' (Managed): Loaded 'v3lyn0nv'

'devenv.exe' (Managed): Loaded 'i26x9yoh'

'devenv.exe' (Managed): Loaded 'zb82-bch'

'devenv.exe' (Managed): Loaded 'ayzow2sm'

'devenv.exe' (Managed): Loaded '_5egs0ut'

'devenv.exe' (Managed): Loaded 'wbbsra3u'

'devenv.exe' (Managed): Loaded 'nz7hepkv'

'devenv.exe' (Managed): Loaded 'g4hkekzj'

'devenv.exe' (Managed): Loaded 'hawwgumi'

'devenv.exe' (Managed): Loaded 'quu3rag3'

'devenv.exe' (Managed): Loaded 'pasxxqvs'

devenv.exe Information: 0 : Execution result was Finish

devenv.exe Information: 0 : ------------------------------------------------------------------------------------------------------------------------------------------------------


Any other suggestions?


charlyfriend wrote:
There are several places.
You can add some bkps in the CodeGeneration.Strategies library, (look for TextTemplateCodeGenerationStrategy class)


Developer
May 19, 2008 at 2:20 PM
Check out these steps:
1) Open VS with WSSF as Admin (regular hive)
2) Open your sample app as user in Exp.Hive
3) Attach #1 to #2 
4) Run #2 and check bkps hits.