views:

435

answers:

7

I'm having so many problems getting more than 1 MVC project up and running on the same server... I'm using a Windows XP system running the default IIS (5.1 I believe).

At this moment I'm even building WebSetup projects for every project I create to make sure everything goes well, while these projects could very easily be deployed using XCopy.

Bottom line, I can get a MVC project (e.g. ContactManager example) running at: http://servername, OR http://servername/ContactManager. But as soon as I have a project at both locations the horror starts

"title is not a member of ViewPage" -> yeah, right...
Section or group name 'system.web.extensions' is already defined. -> sure 
let me <clear /> or <remove /> that one, oh that's not valid... 

Is it even possible to have more than 1 ASP.NET MVC project (application) running on the same Windows XP machine?

http://server/       Root project  (MVC)
http://server/app1   Application 1 (MVC)
http://server/app2   Application 2 (MVC)
http://server/appX   Application X (MVC)

Can somebody name some points of attention or something?

+1  A: 

IIS5.1 that comes with XP only supports one web site (but multiple virtual directories). This i believe will be your limiting factor.

IIS6.x and above where you have many web sites (and many application pools) is preferred when trying to get multiple MVC apps on the same server.

EDIT You could always use the free version of VMware Server and just create heaps of VMs with XP for testing/development.

cottsak
I'd upgrade to IIS 6.0 personally.
peacedog
Me too (if i could).
cottsak
I'm talking about multiple websites as applications. So the rootapp at http://server/ and sub-apps at http://server/app1, http://server/app2 etc..
Ropstah
@ropstah: Yeh i get what you're saying but its possible each MVC app may need an actual 'website' rather than just an 'application'. I dont know this for certain.. but there's many IIS5.1 limitations that are not documented well.
cottsak
what peacedog said - IIS5 is stone age technology
annakata
A: 

are there 2 separate application defined in IIS?

Alex
Yes there are. Root is called "Intranet", Subproject is called: "ContactManager"
Ropstah
A: 

On XP, a solution would be to use an Apache server with Mono 2.4. It works very well with ASP.NET MVC, and even with SQL Server (<= 2005). Hopefully, one day, we'll see this packaged with some future version of Xamp or EasyPHP :) That will enable everybody who is curious to give it a try.

TigrouMeow
Your solution looks very interesting (at least for me) but I think not in this case
eu-ge-ne
A: 

Ensure that the root folder of each application, in IIS manager, is set to be a different web application.

Richard
This is the case. A WebSetup project in Visual Studio does this automatically by the way.
Ropstah
+3  A: 

Yes this is possible. I have 3 MVC applications running under 1 main MVC application.

- Main site
           - Administration
           - Sub App 2
           - ...

However, you need to check the following details.

  1. check the main and sub applications are all setup to use the wildcard mapping for MVC with aspnet_isapi.dll.

  2. due to inheritance of web.configs you need to set a property in your root MVC application... wrap this around your < system.web >

<location path="." inheritInChildApplications="false">
   <system.web>...
</location>
David Liddle
Thanks for your comment. It's not related to web.config inheritance though. But your answer is what I needed to know. Eu-ge-ne get's credit for giving the (same) answer first and for his effort. You get up-votes for short-to-the-point answering ;)
Ropstah
just hope it helped ;)
David Liddle
+4  A: 

Is it even possible to have more than 1 ASP.NET MVC project (application), running on the same Windows XP machine?

Yes, it is absolutely possible to have more than 1 ASP.NET MVC application at same Windows XP machine. I've just created two new ASP.NET MVC applications on my test machine running fresh Windows XP SP3 and they works smoothly.

UPDATED:

I've just created 3d application:

  • IIS root path changed to that application
  • Added mapping .* to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll.
  • Checked anonymous access

Still all 3 applications works very well

UPDATED:

There is one issue with mapping .* to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll at the server root: all your not-MVC plain ASP.NET applications will stop working.

Home this helps

eu-ge-ne
That was my question exactly :). Did you have one project at root (server/), and one project as sub? (server/sub/) ?
Ropstah
Yes - localhost, localhost/mvcapp1 and localhost/mvcapp2
eu-ge-ne
I found some nasty information on http://forums.asp.net/t/1406317.aspx Turns out that every time you edit the masterpage something goes wrong with reference to System.web.mvc.ViewMasterPage. Can you edit the HTML in your masterpage, rebuild and see if the site still works?
Ropstah
Just added some HTML to Site.master in all 3 applications - nothing changed;I also cleared the cache in my Firefox and restarted IIS service; All 3 applications still working without any error
eu-ge-ne
Strange, i'm gonna build some default empty apps and deploy. From there i'll edit those to see where it goes wrong. Thanks!
Ropstah
how do you structure the file system for this? are the folders separate or is the sub project inside the root project folder?
gabe
A: 

I came across this post that should give you an easy and clean way to do it (with subdomains): http://blogs.securancy.com/post/ASPNET-MVC-Subdomain-Routing.aspx

TigrouMeow