Debug CodeDress

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 MDrivenServer

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 MDrivenServer

So far soo good – but this still roundtrips the assemblies up to the MDrivenServer, and downloads them back into your local turnkey app. It would be good if we could tell Turnkey to fetch CodeDress assemblies from somewhere closer.

To set this up amend the MDrivenServerOverride setting with a CodeDressOverride attribute pointing out where you have fresh CodeDress assemblies:

Debugcoderess image 12.png

Make sure to make this location accessible for your apppool account (just give full access to everyone)

Make code changes, Kill w3wp, refresh page – attach w3wp – debug new code without sending code to cloud MDrivenServer.

Scenario 3: Debug/Test CodeDress outside of Turnkey

Scenario 4: Debug MDrivenServer CodeDress connected to cloud DB

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