0

This is a part of my multilingual website code . i am getting a runtime error

           Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            rm = new ResourceManager("Resources.Default.apsx", System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes("E:\\New folder\\multi_lang\\multi_lang\\App_LocalResources")));
            ci = Thread.CurrentThread.CurrentCulture;

Here i am gettingan error in second line saying

1.Make sure you have sufficient privilages to access this resources

  1. if you are attempting to access a file, make sure it is not Readonly.
rick
  • 913
  • 6
  • 13
  • 28
  • Can the server access `E:\\New folder\\multi_lang\\multi_lang\\App_LocalResources` ? and does the user that the webserver is running as have permissions to open that file? – Ghost Jul 02 '12 at 18:17
  • You need to do something like `typeof(MyType).Assembly` where `MyType` is in the same assembly as the resource file you're trying to load. You aren't going to get an assembly by reading the byte-wise contents of a folder. – mellamokb Jul 02 '12 at 18:19
  • @mellamokb can you please give me the exact code where to write this ?? i really need to completely this project soon – rick Jul 02 '12 at 18:21
  • You might want to be a little less demanding. StackOverflow is not a contractor, and isn't here to do your job. – Erick T Jul 02 '12 at 20:05

1 Answers1

0

Make sure the person that you're running IIS under has access to:

E:\New folder\multi_lang\multi_lang\App_LocalResources

Under IIS6 it's more than likely IUSR, under IIS7 it needs to be your app pool user: IIS AppPool \ -AppPoolUser-

AaronS
  • 7,649
  • 5
  • 30
  • 56
  • Right-click the folder on the machine, and under the security tab grant rights to the appropriate user. – AaronS Jul 02 '12 at 20:33