Home > debugging, flash builder, tips & tricks > Debug Flex and .NET using ASP.NET Development Server

Debug Flex and .NET using ASP.NET Development Server

July 29th, 2008

If you followed my previous post you probably now have a Flex + .NET project that makes a WebService call. If not, here’s a project you can use testDotNet.zip. To import this in Flex Builder choose File->Import->Flex Project and follow the steps.

Next open Visual Web Developer and open a Web Site in the same location as the Flex Builder project.  Open web.config and make sure you have <compilation debug=”true”> (this inserts debugging symbols for the .NET code).

Now we need to use the same ASP.NET Developer Server for both the Flex Builder and Visual Web Developer. Since by default both tools try to start one instance we need a little trick to do that:

Start the MXML project through Flex Builder; this will start ASP.NET Developer Server usually on port 3000. Then go to Visual Web Developer; on Project Property Page (Right Click on the Project in the Solution Explorer) click Start Options and select Use Custom Server and enter http://localhost:3000/testDotNet/

image

Start also the .NET project just to connect the Visual Web Developer to the ASP.NET Developer Server instance. Now you will be able to debug both Flex and .NET code:

image

image

Categories: debugging, flash builder, tips & tricks Tags:
  1. May 5th, 2011 at 04:03 | #1

    Greetings.

    Great post, I think I’m nearly able to debug both the ASP.NET page and Flex app, but my situation is different (using an ASP Web app and not a Web service for starters).

    I have a flex app that I’m embedding in an ASP page using swfobject.js. I put the two projects in the same folder as described in this blog and I can run the .NET Web app in Visual Studio 2008 and it correctly invokes the embedded Flex app, etc. But I’m not able to debug them side by side: to debug the Flex app, I have to start it first using the ASP.NET Developer Server but it starts in a dedicated browser window. If I then start the VS .NET project, it connects to port 3000 but the Flex app embedded there is not the same (debuggable) session running in a different window/tab.

    I’m using ExternalInterface to communicate between the Flex app and the ASP page and would like to be able to debug this configuration. Any thoughts on how I can do so (without Amethyst)?

Comments are closed.