How to prevent asp.net recompiling when folder deleted from app_data? - asp.net

To Reproduce:
1. Create an asp.net website.
2. Compile and browse the default page. Keep the browser open.
3. Add a file to the app_data folder.
4. Refresh the default page. This should be fast...no recompile.
5. Delete the file from the app_data folder.
6. Refresh the default page. This should be fast...no recompile.
7. Add a folder to the app_data folder.
8. Refresh the default page. This should be fast...no recompile.
9. Delete the folder from the app_data folder.
10. Refresh the default page. This will be slow because the site recompiles.
Is this by design? If so, what are the benefits of this behavior?
Is there a way to disable or prevent this from occurring?

Yeah it's funky, but check out this blog from Tess, she's a ASP.NET Escalation Engineer...you will want to read her section on "Why does an application domain recycle?".
Tess' blog - http://blogs.msdn.com/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx
In that section she makes a reference to another blog by Todd Carter and apparently this behavior is by design to fix a bug involving preventing deleted content from being served up.
Todd's blog - http://blogs.msdn.com/toddca/archive/2006/07/17/668412.aspx

This by design, the app_data folder along with others are "special" asp.net folders. If you are removing files and folders to the file system you probably don't want to do it in any of the asp.net application folders. Read the link below for a detailed explaination of the folders.
http://aspalliance.com/1202_understanding_aspnet_application_folders

Related

Removing IIS APPPOOL/MyPool from folder does not cancel file write permissions

I have an ASP.NET 2.0 application under IIS 8.5 in Classic mode where a page needs to write uploaded files to a folder outside the root of the app. When I first tired this I got something like
Access to the path 'D:\events\uploads\myfile.txt' is denied.
In the Security tab of D:\events I added "IIS AppPool/MyAppPool" and activated the Write permission. Everything worked fine then - as it should.
However, after removing the MyAppPool from D:\events again the same page was still able to write files under D:\events. Scary. A few experiments showed that that the page can now write files everywhere except C:\ C:\Windows C:\Users and D:.
UPDATE: To check which user or group might give access to IIS/ASP.NET I have created a folder C:\TestIISAccess disabled permission inheritance and gradually removed users and groups. Well, there are none left now, I can not even look inside the folder as admin. But my .aspx upload page reports it can still write files there. I have stopped & restarted IIS after all users were removed, makes no difference.
Can some please explain this behaviour and tell me how to cancel the write permission?

Bootstrap Controller not working in

bootstrap controls are not working after hosting website in IIS. Is there any solution for solving this problem. This project is completely done.
Check iis have permission to access folder contains bootstrap. You can do this by
Open your site in Chrome
Setting-> More options -> View source
Click on "Bootstrap" link.
This problem may cause on some hosts if folder name contains .(dot), like bootstrap-3.1.1

ASP.net This is a marker file generated by the precompilation tool, and should not be deleted

I am currently getting this when visiting my http:// websitehere.com/excelData.aspx page:
This is a marker file generated by the precompilation tool, and should not be deleted!
The file system directory on the server looks like this:
--mainDir
|--excelData.aspx
|--PrecompiledApp.config
|--Web.config
|--bin
|--App_Web_cuydkh1j.dll
|--exceldata.aspx.cdcab7d2.compiled
Not sure what I need to add/remove in order for it to display my page without that precompilation tool text on it.
The IIS server is version 6.1
One of the reasons for this problem is the file PrecompiledApp.config is missing from the root of your site (this file is generated by the publishing wizard).
Hope this help others.
Problem:
When you upload the web application, sometimes the most important files in the bin folder (e.g., the .dll files) will not upload correctly.
Solution:
Re-upload the bin folder. Remember to overwrite.
Make sure the site is configured as an application on IIS

You are attempting to open a precompiled Web site

I have a website developed in asp.net. Files have both aspx pages and codebehind files. When I try to open it in Visual studio 2010, I get this message:
---------------------------
Microsoft Visual Studio
---------------------------
You are attempting to open a precompiled Web site. You can view the site, but changes might cause the Web site to stop functioning. To modify a site, it is recommended that you edit the files in the original Web site, precompile the site, and then publish it again.
Do you wish to continue and open this Web site?
---------------------------
Yes No
How to open this website for editting ?
I know this is WAY late but it might be of use to subsequent readers.
First off, Martuza Kabul is wrong. You only need 2 files, the .aspx/.ascx/.master and the relevant .cs (this means .aspx.cs/.ascx.cs/.master.cs)
What has most likely happened here is that somebody has compiled the site and the DLLs are now lying in the bin folder. (If you are as lucky as i am, they're also in source control..)
Here's what you need to do:
Delete the PrecompiledApp.config file
Delete all the non library .dll files in your bin folder (mine were WebApp_122141Xas or something like that, these are compiled codebehind files.)
Look at the first line of your .aspx / .ascx pages - In that control tag - in there is an "inherits" attribute... you will see it has 2 values, delete the 2nd one.
In that same control tag, notice that the Codefile attribute is missing. Add it and point it to the correct codebehind file.
That should be it. Hope this helps somebody.
You have to have CS file to edit the website. I assume that you are trying to open a website which was published earlier using precompiled option.
Pls post type of files in your website for further information.

Deploying a Pre Compiled Web Site Project

So I have a website project, which I precompile when I publish.
I have a question, when I need to make a small change to the deployed site, do I have to rebuild, re-publish and deploy the entire website structure again, or can I just copy the modified aspx page and the bin directory?
Please let me know!
Thanks guys!
It is going to depend on how you did the precompiling of the site.
According to MSDN, if you did a precompile for deployment, the process takes aspx files and processes any internal code in them, so you will need to recompile everything.
If you did a precompile for deployment and update, the aspx files are not taken into consideration, so provided all you did was some UI changes, you can push the updated aspx file up without issue.
You should be able to republish locally and then copy up the modified published pages and the bin folder.
You shouldn't need to upload everything.
If you pre-compile epending on the options you have chosen you may be able to edit the .aspx page i.e. HTML code, but not the code-behind..
If the .aspx pages become just placeholders i.e. they are empty inside except for a single comment, you cant.

Resources