Refreshing auto-compiled code in iis 7? - asp.net

I'm debugging som asp.net code on a asp-classic site. The layout is sporadic and chaotic - .aspx and .aspx.cs files are in the root directory of the site, some in the app-code folder, but not the relevant file).
My problem is that i need to implement the corrections to the .aspx.cs file. Replacing the file does nothing, and i thought i could just "recycle" the application pool in the IIS manager, but no cigar. The server still loads the same buggy code.
So: How do i go about clearing the auto-compiled binary for this code, and implementing the corrections?
Thanks a bunch :)

A full clean up for ASP.NET involves deleting all the temporary binaries
By default they are in ( depending on 32/64 bit and framework version )
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
I also recommend that you change the temporary folder in the machine scope web.config

If the site is pre-compiled, changing the aspx.cs file won't do a thing. You'll have to recompile the ASP.NET web application/web site project and copy the output .dll to the bin folder.

Related

ASP.NET become very slow when add or remove dll in bin folder

I have an ASP.NET site (.NET 4.0) with ~1200 dlls files
Every time I change dll in bin folder (add, remove or replace), my site became to very slow and need to wait about 10 minutes to connect again, sometime need to reset IIS
Is there any way to settings ASP.NET or IIS just load new dll, do not reload all dll?
Thank all!
ASP.NET dynamic compilation enables you to modify your source code without having to explicitly compile your code before you deploy your Web application. If you modify a source file, ASP.NET automatically recompiles the file and updates all linked resources. By default, ASP.NET Web pages and code files are compiled dynamically when users first request a resource, such as an ASP.NET page (.aspx file), from a Web site. After pages and code files have been compiled the first time, the compiled resources are cached, so that subsequent requests to the same page are extremely efficient.
You can retrieve more information about ASP.NET dynamic compilation:
http://msdn.microsoft.com/en-us/library/ms366723(v=VS.100).aspx

Does deploy of a pre-compiled IIS site show faster first load times?

Using the asp.net compiler I have compiled a site with aspx pages. The contents of the pages have been replaced with placeholder text and the bin folder now contains multiple App_Web_*dll files. There are also multiple *.ascx.hash.compiled files.
I've copied this folder to the webserver and deployed by creating a Virtual Directory that points to this folder. The site works but I am not seeing any improvement in first load times.
When the first aspx is requested, the IIS asp.net cache is rebuilt in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files. This is as time consuming as dynamic compilation of source files. It almost seems like the site is being recompiled. The layout of the IIS asp.net cache is different from the site folder. There are App_Web_*dll files in the cache folder but different names compared to the site.
Am I missing some configuration to get this working right?

Where does IIS look for files

Can anyone explain, please, exactly how .net works. I create a web site in Visual Studio and publish it to a local server to a folder at
D:\WebSites\Project1
I create a web site in IIS and provide the address of the folder containing the files for the web site. When I publish the site, using 'fixed naming and single page assemblies', all the .aspx files go in the folder on the D drive and a dll for each page goes in the bin folder inside that folder.
I would assume that when someone wants to view a page in their browser, IIS retrieves the file(s) required from the folder specified, they get processed and turned into html and sent to the browser.
Recently when someone clicked a button on a page that calls a web service - a file not found error was reported. Apparently
C:\Temp\bx5tn2js.dll
could not be found. The thing is - why did IIS decide to look in C:\Temp for a file?
And, in the error message was a load of references to xml serialization. What is being serialized?
This file looks like the compile files that asp.net generates on compile.
This folder can be setup on web.config on compilation session with the
tempDirectory="C:\Temp"
If you do not have set this option asp.net is use a default folder that is usually inside the asp.net directory, inside the windows folder. But if you have set this, and this folder did not have the correct permissions, then asp.net fails to compile the project, and you can get a message like that.

Compiling a 6GB site

This morning I moved a .NET website from our local server to live (not pre-complied). When I go to the url the sites hosted on the browser starts loading the site and has been doing this for the last hour. I presumed it is compiling the site and its just taking a while because of the size of the site. Is there any way to check if this is definitely the case and there's nothing else happening?
Put your images in a spearate folder, not in your virtual directory for the application.
# ck. You obviously haven't used Umbraco before because Umbraco cannot be hosted in a virtual directory.
Umbraco bin zip comes with the site precompiled. I am assuming the reason your site is compiling is because you have ascx usercontrols with ascx.cs files. Maybe some App_Code .cs files.
Put those in another Web Application project. Compile it, and just move the .dll and .ascx files over to the appropriate directories.
Put your images in a spearate folder, not in your virtual directory for the application.
I.e.
Default Web Site
- Picture folder (5.8GB)
- Application virtual directory (small application)

Obscured URL in ASP.Net Webforms

I am working on a ASP.Net web forms application which I inherited from a programmer who has already left the company a few months ago.
The application is deployed in our intranet servers and user go the application via the url:
http://TestApp/App1/(12345abcde)/login.aspx
When I checked the IIS Server, the application's folder is only set to
\inetpub\wwwroot\TestApp\App1\
and from that folder, you could see the login.aspx file.
I'd like to ask what IIS settings did the previous programmer tweaked so that the URL is a bit obscured, where the imaginary(?) folder named (12345abcde) has been inserted. Which settings do I need to check for in the IIS for this?
Another question is that in the login.aspx file, the following can be found: Codebehind="Login.aspx.vb", but the same file Login.aspx.vb is not on the application's directory. Although I did see that there is a bin folder where a dll file resides. Is it possible that the vb code behind file is compiled into that DLL?
By the way, if there is an available dll viewer which I could download, kindly post the same so that I could inspect the DLL in the webforms app.
Appreciate your inputs. Thanks.
This comes from using cookieless sessions in ASP.NET.
Basically, instead of storing the session id in a cookie, it is passed as part of the URL, which makes the app usable even when cookies are disabled in a browser.
To enable/disable this feature, use the following web.config entry:
<sessionState cookieless="true" />
Regarding your second question: when you use the "publish web site" function in Visual Studio, all code-behind files are compiled to DLLs (in the bin folder), and the ASPX file are changed to include a reference to the corresponding DLL (in the <#Page > directive).
And regarding the "dll viewer": have a look at .NET Reflector.

Resources