Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jonok 273 posts 521 karma points
    1 week ago
    jonok
    0

    How to add custom code - can I use app_code folder?

    Does Umbraco v9 allow us to add custom cs files in the app_code folder? I have sites that are deployed to an IIS server and I sometimes need to add small pieces of functionality, and rather than do a complete new build & publish, I'd just like to add a CS file, similar to previous versions of Umbraco. Is this still possible in Umbraco v9?

  • Sebastiaan Janssen 4959 posts 14913 karma points MVP admin hq
    1 week ago
    Sebastiaan Janssen
    100

    No, you can't, App_Code is no longer a thing in ASP.NET Core. All the code that's part of your project needs to be built before it's published. Luckily, publishing code is also a lot lighter-weight in ASP.NET Core. :-)

  • jonok 273 posts 521 karma points
    1 week ago
    jonok
    1

    Thanks Sebastiaan, makes sense. So if I wanted to add some custom code to hide the 'redirect URLs' dashboard, where would I place a custom class file in the project so that it builds into the project?

  • Sebastiaan Janssen 4959 posts 14913 karma points MVP admin hq
    1 week ago
    Sebastiaan Janssen
    0

    Anywhere you want! That's the beauty, it will build any .cs files it finds, in the whole project. 😁

Please Sign in or register to post replies

Write your reply to:

Draft