tags:

views:

1563

answers:

3

Hello. I tried to precompile my ASP.NET MVC application and deploy it to an IIS6 box (with wildcard mapping), however I am getting an error with rendering partial views (user controls). Its working fine on my dev machine before precompiling.

The error is:

Server Error in '/' Application.

The partial view 'ListGrid' could not
be found. The following locations were
searched:
~/Views/Initiative/ListGrid.aspx
~/Views/Initiative/ListGrid.ascx
~/Views/Shared/ListGrid.aspx
~/Views/Shared/ListGrid.ascx

I checked Views\Shared for the file and it was not there, which I thought was normal because its precompiled. But just for giggles I put a blank file in that folder names ListGrid.ascx, but then I got this error:

Server Error in '/' Application.

The file '/Views/Shared/ListGrid.ascx'
has not been pre-compiled, and cannot
be requested.

I googled and searched SO but could not find any similar problems, but had no luck.

+3  A: 

Although you can precompile an MVC site the ascx and aspx view files are not in the compiled dll only the .cs files are. You will still need to deploy the .aspx and .ascx view files.

Hope this helps

Richard
Actually, the precompiled website contains everything, including the ascx and aspx files. The originals still need to be present for the ASP.NET runtime to access them in binary form, but they're just placeholders and don't contain any content.
Dave Van den Eynde
A: 

you shouldn't have to, .aspx files works well, because of the .compiled files in /bin, but some how asp.net mvc is unable to see the ...ascx.compiled files ! :(

Carl Hörberg