Copied to clipboard

Flag this post as spam?

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


  • stephencai 21 posts 131 karma points
    May 16, 2019 @ 05:03
    stephencai
    0

    Umbraco new project razor issue

    I am facing an issue about the razor file shows an error message: "The name 'model' does not exist in the current context'

    I tested many solution but still cannot fix it.

    Situation: My Solution -- Main project (installed umbraco) - not that issue -- project A for website A (empty project) - issue occur -- project B for website B (empty project) - issue occur

    How can i solve this error message?

    enter image description here

    enter image description here

  • Ronak Panchal 71 posts 230 karma points
    May 16, 2019 @ 06:09
    Ronak Panchal
    0

    Hello stephencai,

    if you are using visual studio then in an empty project install Umbraco.core library from NuGet Umbraco core

    and second thing if you already install the core repos in the class library project then add the reference to your website project.

    Hope that will help, Ronak Panchal.

  • stephencai 21 posts 131 karma points
    May 16, 2019 @ 06:33
    stephencai
    0

    tried to install the Umbraco.core library and added the reference. But the error still there.

  • Ronak Panchal 71 posts 230 karma points
    May 16, 2019 @ 08:35
    Ronak Panchal
    0

    Have you added the namespace?

  • stephencai 21 posts 131 karma points
    Jun 09, 2019 @ 14:10
    stephencai
    0

    Hi ronak,

    Sorry for late reply.

    Do you mean "@using XXXX"? There is my project structure.

    enter image description here

  • Ronak Panchal 71 posts 230 karma points
    Aug 01, 2019 @ 09:44
    Ronak Panchal
    0

    Hello stephencai,

    This is not related to Umbraco but you are trying to add a view in-class library project.

    You can make an API controller and surface controller for Umbraco and class files in the class library project. for the view, Your project must be a Web Application for IntelliSense to work properly. Web Application is just a special class library.

    Hope you that may help,

    Ronak Panchal.

Please Sign in or register to post replies

Write your reply to:

Draft