views:

274

answers:

1

I've moved one of my classes to the App_Code folder (and namespace) and inside of this class I have a reference to a global resource:

using Res = myProjectName.App_GlobalResources.Validation;

Before I moved this class to the App_Code folder, everything worked alright. Now I get a runtime error stating that:

CS0122: 'myProjectName.App_GlobalResources.Validation' is inaccessible due to
its protection level

If I go into the designer code for the Validation.resx (Validation.designer.cs) and change the internal class Validation to be public (public class Validation) then it works fine.

How come I can't access this as normal from inside the App_Code folder?

Is it because the App_Code and App_GlobalResources content are dynamically compiled, and at runtime, App_Code is compiled first and my Validation Resx hasn't yet compiled?

Thanks for any answers.

A: 

You may take a look at this article.

Darin Dimitrov
Thanks Darin. I actually went ahead and manually replaced "internal" with "public" for this particular resource .cs file and that solded the problem. I assume that's the same thing this software does.
Jamie Dixon