Editable Routes In Medium Trust.aspx

suggest edit
Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

16 responses

  1. Avatar for Pita.O
    Pita.O January 18th, 2010

    Hi Phil,
    This sounds great, especially for the use case you describe. One key problem is that the cloud is here! We no longer have those luxuries of change without compiling. We will always have to repackage even to change web.config. So if the route cannot be configured in .cscfg then it won't save you much of the roundtrip (cloudwise). Just for perspective.

  2. Avatar for ben
    ben January 18th, 2010

    I like it.

  3. Avatar for haacked
    haacked January 18th, 2010

    By the way, I updated the original post to work in medium trust and I think it's probably a better approach.

  4. Avatar for haacked
    haacked January 18th, 2010

    @Pita Are you saying that content files, virtual path providers, etc. won't ever work in the cloud?
    Most likely, my IronRuby approach would still work because content files are allowed. haacked.com/...

  5. Avatar for John
    John January 18th, 2010

    As you are using the app_code I am correct in thinking for MVC projects that are created as Web Applicaions (rather than website projects) this will not work as you cannot use the app_code folder?

  6. Avatar for Aleč Roubíček
    Aleč Roubíček January 18th, 2010

    @John there is no reason to App_code should not work with WAP. They are same at runtime.

  7. Avatar for John
    John January 18th, 2010

    After some research App_Code is not supported in WAP ( msdn.microsoft.com/.../aa983464%28VS.80%29.aspx), you do not get the option to add it and if you add it manually it then publish the site compiles the files it into the main DLL and does not include the directory.
    I guess the other method will be the best option in that case.
    Thanks

  8. Avatar for Stephen
    Stephen January 18th, 2010

    I remember writing something along the lines of the first series of this blog, The route file being watched was in a network drive though and everytime it went down, the filewatcher class would just failt to keep monitoring changes. In the end, i just felt that the extra coding and complexity introduced was not worth the benefit. Very good article.

  9. Avatar for haacked
    haacked January 19th, 2010

    @John Aleč is correct. Code in the App_Code directory is compiled at runtime using the ASP.NET compilation system.
    The distinction between Web Application and Web Site projects is a Visual Studio Project distinction, not a runtime distinction.

  10. Avatar for Salman Farsi
    Salman Farsi January 19th, 2010

    Sounds greate

  11. Avatar for Thanigainathan
    Thanigainathan January 19th, 2010

    A fantastic article from Haacked.
    Thanks,
    Thani

  12. Avatar for Bret Ferrier
    Bret Ferrier January 20th, 2010

    So does this mean that you are working on an edition of Subtext that will use ASP.NET MVC 2.0??
    There are very few good open source asp.net mvc applications out there. I have been thinking of changing my blog provider or rolling my own.

  13. Avatar for iPhoneKönig
    iPhoneKönig January 23rd, 2010

    Thank you for these useful informations. i will apply them right away

  14. Avatar for Andrew
    Andrew January 24th, 2010

    Not a bad solution.
    Another solution would be to put your routes in an Xml file, load it on application_start and set up a cache dependency to check for changes. Less elegant sure but at least it doesn't restart your app, and I don't like the pattern of dropping .cs files into your app_data folder and automatically kicking off a recompile. Sounds like a potential configuration nightmare.
    Thanks for the great article though.

  15. Avatar for John Dyer
    John Dyer February 1st, 2010

    I'm trying to use something like this to build a CMS (in 4.0) that uses a catch-all and constraints to determine which URLs to handle. The problem I'm getting is that catch-all/wildcards don't catch URLs with a trailing slash (/). I know it's a bit off topic, but do you know a way to catch the trailing slash on a catch-all?

  16. Avatar for Pes 2011 Patch
    Pes 2011 Patch August 16th, 2010

    Thanks for information bro.