locked
The resource object with key 'Login' was not found. (asp.net and azure) RRS feed

  • Question

  • User-1178735859 posted

    I publish web app and database to azure, and I can link my local to azure database. the web app is working on my local. but I run paxxxxxx.azurewebsites.net, I got the error:

    The resource object with key 'Login' was not found.

    <asp:MenuItem Value="Login" Text="<%$Resources:Resource.us,Login%>" NavigateUrl="~/Account/Login"></asp:MenuItem>

    I open vs2013 and I can find the key in "Resource.us.resx" and "Resource.zh.resx" on "App_GlobalResources" folder.

    I am not sure what is going on (the point is the web is working on my local when I link to azure database).

    I can find some info on "app service editor":

    in "bin", I can find "resources.dll" file in "zh" only, it means I miss "us" file?

    thanks for any idea.

    Sunday, July 23, 2017 6:20 PM

All replies

  • User1068175894 posted

    right-click properties on your resource file and change the "Build Action" to "Content" and see if that adds your resource to the bin folder

    Monday, July 24, 2017 3:18 AM
  • User1296332936 posted

    Other than what JBetancourt mentioned, you will have to Set the .resx file to "Copy to Output Directory" to Copy always.

    Tuesday, July 25, 2017 3:16 PM
  • User-1178735859 posted

    Thanks. I did both like you and JBetancourt. the error is gone. but I got new error:

    Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Resources.Resource.resources" was correctly embedded or linked into assembly "App_GlobalResources.thxpsmte" at compile time, or that all the satellite assemblies required are loadable and fully signed.

    Tuesday, July 25, 2017 3:49 PM
  • User-1178735859 posted

    finally the problem is fix.

    what I did 4 steps:

    1. set 2 resource files "content" and "copy if newer".

    2. publish

    3, set 2 resource files "embedded"

    4. publish again.

    Thanks guys

    Thursday, July 27, 2017 2:22 PM