views:

46

answers:

1

Hello all,

I created an asp.net web application that can create dynamically asp.net web application projects within it's file system (subdirectories).

Lets say I manually create Virtual Directory in the IIS for each webapp created.

When I try to access those applications (http://localhost/<virtual-dir>/) I get an error:

Parser Error Message: Could not load type 'Template29.Template29'.

Source Error:

Line 1: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Template29.master.cs" Inherits="Template29.Template29" %>

Line 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

What am I doing wrong?

Thanks in advance,

Gal.

A: 

Is your virtual directory set as application in IIS ? If so, maybe you have some problems with web.config inheritance :

http://msdn.microsoft.com/en-us/library/ms178685.aspx

btw. you could use Microsoft.Web.Administration assembly to automate creation of new sites on IIS 7, it's awesome :)

http://blogs.msdn.com/b/carlosag/archive/2006/04/17/microsoftwebadministration.aspx

http://learn.iis.net/page.aspx/165/how-to-use-microsoftwebadministration/

Antonio Bakula
Hello Antonio and thanks for your answer,- My Application is set as an application in the IIS.- My web.config is edited in relevant places for inheritance issues: <location path="." inheritInChildApplications="false">- I'm currently using IIS 5.1.- Notice that if I open the application in VS2008 and run it under it's own localhost asp.net server, it work's perfectly. the problem occurs only when I try to access the application through it's virtual directory.
Gal V
IIS 5.1 is really old one;) I don't have any expirience runnin ASP.NET on such old IIS version. Witch framework version your ASP.NET application uses ?
Antonio Bakula
Make sure that your IIS is configured to same .NET framework version as your VS 2008 project, it sems that this can cause the same error you get:http://dotnetfish.blogspot.com/2007/10/could-not-load-type-default.html
Antonio Bakula