Home » DotNetNuke - Module Development » Debugging TypeScript Under DotNetNuke

Debugging TypeScript Under DotNetNuke

I’ve been playing with TypeScript for the last couple of weeks and I’ve fallen in love.  Now I can write JavaScript code without having to switch between thinking about the problem in terms of object oriented programming (csharp) and kind of sort of object oriented programming (javascript).

But, what I’ve had trouble getting to work is using the sourcemap feature to debug in TypeScript instead of debugging in the resulting JavaScript.  Not that I can’t read the resulting JavaScript, I can.  But, I invariably end up changing the JS source instead of the TS source.

I also had the added wrinkle that all of my development lately is for DotNetNuke, which has the ClientDependency module wired into it.  Since the map file that gets created knows nothing about this, we have to disable ClientDependency.  Easy, you say, just take it out of the web.config file.  Oh that it were that easy.

You see, like I said, it is WIRED into DotNetNuke.  But all we really need to do is turn off the combining in host settings and then write a URL Rewrite rule in IIS that has the following search and replace.  (I’m assuming by now you know about the IIS7 Rewrite module.)

Regex Search rule: (.+)\?cdv=\d+
Replace: {R:1}

This will make DotNetNuke go after the original source files instead of adding the CDV=versionNumber stuff at the end of the filename.

The second thing you will probably need to do is to add a mimetype for the.ts extension.  At least I had to.  If you don’t do this, than IIS won’t know that it is safe to serve the ts file.  So, once again, in IIS, go to your mime types setting and add a mime type for .ts as text/javascript (OK, it isn’t really javascript but it is close enough).

Hope this saves someone a few hours of searching.

Other places talking about typescript debugging:

Links to related resources


Other post in DotNetNuke - Module Development

Related Post

  • DotNetNuke Modules – Creating Base ModulesDotNetNuke Modules – Creating Base Modules Now that we have DotNetNuke installed into Visual Studio we can go ahead and create our first modules. Actually, creating the modules is pretty simple. But it is even easier to do it […]
  • Debugging SoftwareDebugging Software It amazes me how rare the skill of debugging software is.  It is even more amazing to me that after programming for over 27 years now, I still have trouble with this.  So, as a […]
  • Run NUnit from Visual StudioRun NUnit from Visual Studio For the purposes of this post, I’m going to assume that you already have the NUnit Test Runner installed.  The question you are looking to get answered is, “How do I run NUnit from Visual […]
  • Creating DotNetNuke ModulesCreating DotNetNuke Modules I've decided to start a series on how to create DNN Modules since I have several clients who need to know this information and I don't know of one good place I can send them that has it […]
  • CefSharp Offscreen [Why do I have so many instances of Chromium?]CefSharp Offscreen [Why do I have so many instances of Chromium?] I’ve been using the CefSharp.Offscreen library to drive the Chromium browser for a couple of months now.  While the code I’ve been working on has been working correctly, I could never […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer focusing on ASP.NET, C#, Node.js, JavaScript, HTML, CSS, BootStrap, and Angular.JS.Does your team need additional help in any of the above? Contact Dave today.

One Pingback/Trackback