turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

The directory name C:\www\www.mywebsite.com\locale is invalid. #210

Closed tomasr78 closed 9 years ago

tomasr78 commented 9 years ago

Maybe you will know why I get exception "The directory name C:\www\www.mywebsite.com\locale is invalid." while running web application on IIS7 prod server?

Exception stack

System.ArgumentException: The directory name C:\www\www.mywebsite.com\locale is invalid. at System.IO.FileSystemWatcher..ctor(String path, String filter) at i18n.FsCacheDependency..ctor(String path, Boolean includeSubdirectories, String filespec, NotifyFilters changeTypes, Boolean autoStart) at i18n.Domain.Concrete.POTranslationRepository.GetCacheDependencyForAllLanguages() at i18n.TextLocalizer.GetAppLanguages() at i18n.TextLocalizer.GetText(String msgid, String msgcomment, LanguageItem[] languages, LanguageTag& o_langtag, Int32 maxPasses) at i18n.EarlyUrlLocalizer.ProcessIncoming(HttpContextBase context) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Everything works fine on dev server with IIS Express. The C:\www\www.mywebsite.com\locale folder has the same READ permission as other web app folders on Prod IIS7 and it is empty. I don't have translation yet. Even if I add translation into "C:\www\www.mywebsite.com\locale\lt\messages.po" I still get the same exception. Do I need to give WRITE permission to folder? The description lacks the information for LOCALE folder permissions.

tomasr78 commented 9 years ago

Please delete the issue, problem was solved. Just suggestion, check for "locale" folder exists and throw meaningful exception DirectoryNotFoundException.

turquoiseowl commented 9 years ago

I imagine FileSystemWatcher requests FILE_LIST_DIRECTORY access. Maybe the server process is denied that on the folder.

Also this does ring a bell so maybe worth searching the closed issues if you haven't done so yet.