Debug CodeDress
No edit summary
No edit summary
Line 1: Line 1:
Set up the IIS and install the Turnkey application. You can use the following articles to get help with the installation of IIS and MDrivenTurnkey locally on your machine: [[Development in Visual Studio]], [[Installing MDriven Server on Windows|Installing MDriven Server on Windows.]]  
Set up the IIS and install the Turnkey application. You can use the following articles to get help with the installation of IIS and MDrivenTurnkey locally on your machine: [[Development in Visual Studio]], [[Installing MDriven Server on Windows|Installing MDriven Server on Windows.]]  
== Scenario 1: Debug Turnkey CodeDress with data from cloud MDriven Server ==
== Scenario 1: Debug Turnkey CodeDress with data from cloud MDriven Server ==
[[File:Image 1.png|none|frame]]
Set up your your local turnkey app by copying the template files (green) and rename them to be active(yellow):
[[File:Image 2.png|none|thumb|483x483px]]
In the MDrivenServerOverride.xml point out the MDrivenServer you want to run towards and its password:
[[File:Debugcoderess image 3.png|none|frame]]
Verify that is starts, and that it fetch data from the given MDriven Server:
[[File:Debugcoderess image 4.png|none|frame]]
Make sure your [[AppPool user|Apppool user has full access]] to Log catalog and to ModelCodeAssemblies (easiest way give full control to everyone on these):
[[File:Debugcoderess image 5.png|none|frame]]
As the Turnkey App started it got the zip containing the model and the CodeDress assemblies (your code) from the MDrivenServer.
This fetch is done on start – if you want to restart to fetch to do it again – best way is to kill the w3wp process and refresh turnkey browser:
[[File:Debugcoderess image 6.png|none|frame]]
But maybe the ModelCodeAssemblies are skipped due to Turnkey finding nothing new – you can see this in the log:
[[File:Debugcoderess image 7.png|none|frame]]
To force it – delete the wwwroot\test88\App_Data\AssetsTKChecksum.xml file, and restart.
When successful CodeDress has been performed you should see something like this in the log:
[[File:Debugcoderess image 8.png|none|frame]]
Now you are ready to debug – Start VS and your project holding the model with CodeDress.
Make sure you codegen, then build then upload the current version of the model (build first to ensure you have the correct assemblies available to upload).
Restart your turnkey app (kill w3wp process and refresh browser app-page to force it to start)
In VS do Debug/AttachToProcess – Select managed .NET4 code, Check the Show processes from all users – attach w3wp (the one corresponding to your apppool):
[[File:Debugcoderess image 9.png|none|frame]]
You must be admin and you will get warned:
[[File:Debugcoderess image 10.png|none|frame]]
When your web UI calls your model code your breakpoints will be hit:
[[File:Debugcoderess image 11.png|none|frame]]


== Scenario 2: Debug Turnkey CodeDress without roundtripping code changes to MDriven Server ==
== Scenario 2: Debug Turnkey CodeDress without roundtripping code changes to MDriven Server ==

Revision as of 21:39, 29 June 2022

Set up the IIS and install the Turnkey application. You can use the following articles to get help with the installation of IIS and MDrivenTurnkey locally on your machine: Development in Visual Studio, Installing MDriven Server on Windows.

Scenario 1: Debug Turnkey CodeDress with data from cloud MDriven Server

Image 1.png

Set up your your local turnkey app by copying the template files (green) and rename them to be active(yellow):

Image 2.png

In the MDrivenServerOverride.xml point out the MDrivenServer you want to run towards and its password:

Debugcoderess image 3.png

Verify that is starts, and that it fetch data from the given MDriven Server:

Debugcoderess image 4.png

Make sure your Apppool user has full access to Log catalog and to ModelCodeAssemblies (easiest way give full control to everyone on these):

Debugcoderess image 5.png

As the Turnkey App started it got the zip containing the model and the CodeDress assemblies (your code) from the MDrivenServer.

This fetch is done on start – if you want to restart to fetch to do it again – best way is to kill the w3wp process and refresh turnkey browser:

Debugcoderess image 6.png

But maybe the ModelCodeAssemblies are skipped due to Turnkey finding nothing new – you can see this in the log:

Debugcoderess image 7.png

To force it – delete the wwwroot\test88\App_Data\AssetsTKChecksum.xml file, and restart.

When successful CodeDress has been performed you should see something like this in the log:

Debugcoderess image 8.png

Now you are ready to debug – Start VS and your project holding the model with CodeDress.

Make sure you codegen, then build then upload the current version of the model (build first to ensure you have the correct assemblies available to upload).

Restart your turnkey app (kill w3wp process and refresh browser app-page to force it to start)

In VS do Debug/AttachToProcess – Select managed .NET4 code, Check the Show processes from all users – attach w3wp (the one corresponding to your apppool):

Debugcoderess image 9.png

You must be admin and you will get warned:

Debugcoderess image 10.png

When your web UI calls your model code your breakpoints will be hit:

Debugcoderess image 11.png

Scenario 2: Debug Turnkey CodeDress without roundtripping code changes to MDriven Server

Scenario 3: Debug/Test CodeDress outside of Turnkey

Scenario 4: Debug MDrivenServer CodeDress connected to cloud DB

This page was edited 69 days ago on 02/10/2024. What links here