Copied to clipboard

Flag this post as spam?

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


  • Jan Egil Kristiansen 37 posts 160 karma points
    Jun 21, 2017 @ 10:17
    Jan Egil Kristiansen
    0

    Using my own C# class

    I have created a Models folder and added a class to it.

    Inside the class file, it says namespace teatertest.Models.

    So I try @using teatertest.Models in my template, but the response is

    CS0246: The type or namespace name 'teatertest' could not be found (are you missing a using directive or an assembly reference?)
    
    • How do I get access to C# classes that I write?
    • Should I use another folder for classes that are not related to MVC?
  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jun 21, 2017 @ 10:46
    Alex Skrypnyk
    0

    Hi Jan

    Are you using website or web application in visual studio?

    If website - all classes should be inside App_Code folder

    If web application - you have to build project.

    Thanks

    Alex

  • Jan Egil Kristiansen 37 posts 160 karma points
    Jun 21, 2017 @ 11:39
    Jan Egil Kristiansen
    0

    I do have an App.Code folder in the file system. But it is not visible in Solution Explorer Does that mean I use website?

    Website or web application, that is a choice I made (but can't remember) when I installed Umbraco?

    Anyway, rebuilding is something I can live with.

    One more question: I don't have my production site connected to Visual Studio. Does Republish Entire Site from Umbraco's web interface do a rebuild?

  • Paul Wright (suedeapple) 277 posts 704 karma points
    Jun 21, 2017 @ 12:04
    Paul Wright (suedeapple)
    0

    Website - The project icon will be a World

    Web App - The project icon will be a Folder/Form Icon, with a little world inside

Please Sign in or register to post replies

Write your reply to:

Draft