AppHarbor: The directory '/App_GlobalResources/' is not allowed because the application is precompiled
Asked Answered
M

2

14

I trying to deploy my ASP.NET WebForms application to AppHarbor. After a succesful deploy I get

The directory '/App_GlobalResources/' is not allowed because the application is precompiled

I disabled the Precompilation in the app settings but it did not help. What should I do? Should I change some settings in my project o is it a server configuration thing?

I found a solution deleting the PrecompiledApp.config but I do not have access to it on AppHarbor.

Managerial answered 2/12, 2012 at 22:17 Comment(1)
This can also happen because of wrong deployment of website in a wrong place.Quass
E
27

All you need to do, if your site is Precompiled, is to make sure that the directory /App_GlobalResources is deleted from your deployment location.

I had the exact same problem, and when I removed this directory it all worked very well.

NOTE: Its good to have your site precompiled so it is faster and more responsive, and therefore it may not be a good idea to remove precompiledapp.config file from your deployment folder.

Evanevander answered 6/3, 2014 at 15:0 Comment(7)
How to make the publish not to publish the /App_GlobalResources folder?Scott
Yes, it can be excluded. View the first 2 FAQs at this MSDN link: msdn.microsoft.com/en-us/windows/ee942158%28v=vs.71%29.aspx. Or simply do this: In web app properties go to Package/Publish Web tab and select 'Only files needed to run this application' AND then make sure all resource files under this folder have their Build Action to 'Embedded Resource' and also 'Do not Copy' is selected for these resource files under 'Copy to output directory' property.Evanevander
After I marked the resource files under App_GlobalResources folder 'Embedded Resource', they are inaccessible due to protection level, do you know how to fix it?Scott
@Jeff, You should be able to edit it in Visual Studio, but you cannot edit it in deployed web app.Evanevander
thank you I have changed default Customer Tool to PublicResXFileCodeGenerator, and now it worked!Scott
@JeffTian This does not work for me, the designer.cs will be empty with that Customer Tool.Madigan
The same problem occurs in Azure as well and this solution fixes it too.Delossantos
M
0

The trick is not only to disable the Precompilation in the app settings but also to deploy a new version so the app gets restarted.

Managerial answered 29/12, 2012 at 12:26 Comment(2)
I'm having the same problem on Appharbor. I couldn't figure out how to disable precompilation on VS 2010.Myles
you need to disable it in the project settings in appharborManagerial

© 2022 - 2024 — McMap. All rights reserved.