0

From a view cshtml in my ASP.NET MVC app I am trying accessing a string in my Resources.resx file without success.

The Resources.resx file is within Properties folder:

MyProject -> Properties -> Resources.resx

It has the following properties set:

Build Action: Embedded Resource 
Custom Tool: PublicResXFileCodeGenerator
Custom Tool Namespace is not set (left blank)

Also in Resources Designer in Visual Studio on the top I have changed the combo Box value for Access Modifier from internal to Public. But it still not working....

From my view cshtml I import the resoureces:

@using MyCompany.MyProject.Resources

and then I use below syntax:

@Resources.MyLabel

I have checked this but it does not work.

Willy
  • 9,848
  • 22
  • 141
  • 284

1 Answers1

1

I have solved by importing the correct namespace:

@using MyCompany.MyProject.Properties

instead of:

@using MyCompany.MyProject.Resources
Willy
  • 9,848
  • 22
  • 141
  • 284