views:

88

answers:

2

Hi,

I have built a few custom applications that run on WSS 3 using the Visual Studio 2010 Web application template. When I compile the application, Visual Studio creates the assembly file in the bin directory which I copy over later to the production server (another machine) with WSS 3. The compiled application dll file is copied into the bin folder inside the virtual directory of WSS and runs fine in there.

As the project requirements / applications grew over time I now face the problem that the first hit on the assembly triggers dynamic complication which I would like to avoid.

Even if applications are running fine I would like to use the asp precompiler on my development machine in order to reduce the delay when the page is first requested.

I have used the following command to precompile the entire Web Application:

aspnet_precompile -v / -p PATH_TO_WEB_APPLICATION C:\WebApp -errorstack

The compilation runs fine without any errors and I end up with a couple of .compiled files and also a Web_App_xxxxx.dll file inside the C:\WebApp\bin folder.

From here onwards I am a bit lost on how to proceed.

Could you give me an advise to which folder I need to copy the compiled files on the production server please?

Do they need to go into the bin folder on the server or better into the folder where the aspx pages are located?

Moreover I would like to know if I can precompile the Web application on a development machine without the IIS metabase using the -v and -p switch and later use it inside WSS?

I copied all files from the C:\WebApp\bin folder to the server bin folder but unfortunately the csc compilation process still kicks in when looking with process monitor at the server events.

Cheers,

Mathias

+1  A: 

The files just need to be dropped into the bin folder and everything will work fine. As for the -v switch you do need to have it if you're using the -p flag, but I think it depends how you're compiling the app too. Check this link out for more. I don't believe its a big deal if its wrong / incorrect though.

This kind of scenario sounds like a job for Cruise Control .NET environment.

Matt
Matt: Thanks for your answer. If I understood you correctly, you are saying that I can copy the .compiled files and the web_app_xxxx.dll file to the bin folder and that's all?Can I run the precompilation on a development machine without the IIS metabase if the application is deployed/copied to the bin directory inside a virtual directory on the server?
mathias florin
@mathias - Open source projects are a great example of this. I download the latest build of Umbraco CMS and just copy the precompiled files into the bin folder for updates. Just so long as there's something provided for the -v switch, then it will work.
Matt
+1  A: 

I found an answer to this precompilation question:

I thought the first hit on the application page takes a long time because asp.net needs to compile it and I can save some time by precompiling. The application runs inside the WSS context and enables the user to go to a web form and update through the form his/her Active Directory profile. The Exchange global address list is also updated on the Exchange forest so the changes are visible through the Outlook address list and also on Communicator.

The complete solution code with reports etc is around 6000 lines of C# code.

My assumption regarding slow compilation due to the amount of lines was wrong.

I downloaded the following hotfix for asp.net: http://support.microsoft.com/kb/961884

and set optimizeCompilations="true" in the web.config as explained here:

http://blogs.msdn.com/b/davidebb/archive/2009/04/15/a-new-flag-to-optimize-asp-net-compilation-behavior.aspx

http://www.paulliebrand.com/2009/09/18/sharepoint-development-to-bin-folder-and-extremely-slow-render-initial-render-times-solution/

Now the first hit on the application is much faster.

Many thanks,

Mathias

mathias florin