Martin Lloyd Jose
Martin Lloyd Jose

Reputation: 470

Type or namespace name 'xxx' could not be found in Umbraco

When I created a class, there is no existing namespace declaration and I need the namespace declaration to access the class from a view (cshtml).

Normally when you create a class, there should be a namespace declaration included right? But for me I don't see any.

I already tried to add a namespace declaration, but I still can't access it from another class.

I hope you could help me with this.

Screenshots: https://drive.google.com/open?id=0B5TGcf9mTeg2V2ZDaldWelp6WXc

ScreenShot

Upvotes: 0

Views: 1429

Answers (3)

Martin Lloyd Jose
Martin Lloyd Jose

Reputation: 470

Just as what Nico Said (https://stackoverflow.com/users/5685258/nico)

Follow this instructions and this will be resolved: https://our.umbraco.org/documentation/Getting-Started/Setup/Install/install-umbraco-with-nuget

Although I started all over again.

~I created a new project from Visual Studio 2017 using ASP.NET Web Application

~Selected an empty file

~ Right click on the project

~ Click Manage NuGet Packages and installed Umbraco CMS

~ Run it from VS and install the umbraco platform using the browser

~ As soon as I create a class, a namespace declaration will also be included.

Thanks!

Upvotes: 1

Matthias Burger
Matthias Burger

Reputation: 5946

Your model belongs to namespace PRL.Models but you try using Prl.Models - namespaces are case-sensitive. Try using PRL.Models

Edit: and for the class without namespace-declaration: you should always have a class in a namespace. Declare one.

Upvotes: 0

NicoXiang
NicoXiang

Reputation: 436

make sure your namespace name is correct .using PRL(Capitalized) .Models .And the good practice is add an empty web application project ,not a website.

Upvotes: 1

Related Questions