5

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?

2
  • @Alex: good question. @ropstah: do you know if both the "servername" and "servername/ContactManager" have an (IIS) Application associated with them or is the "servername/ContactManager" site possibly running in the same application as "servername"? Commented May 11, 2009 at 11:30
  • Both root and subproject have their own applicationname. Root: "Intranet", Sub: "ContactManager" Commented May 11, 2009 at 12:09

7 Answers 7

4

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

Sign up to request clarification or add additional context in comments.

7 Comments

That was my question exactly :). Did you have one project at root (server/), and one project as sub? (server/sub/) ?
Yes - localhost, localhost/mvcapp1 and localhost/mvcapp2
I found some nasty information on 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?
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
Strange, i'm gonna build some default empty apps and deploy. From there i'll edit those to see where it goes wrong. Thanks!
|
3

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>

1 Comment

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 ;)
1

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.

4 Comments

I'd upgrade to IIS 6.0 personally.
I'm talking about multiple websites as applications. So the rootapp at server and sub-apps at server/app1, server/app2 etc..
@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.
what peacedog said - IIS5 is stone age technology
0

are there 2 separate application defined in IIS?

1 Comment

Yes there are. Root is called "Intranet", Subproject is called: "ContactManager"
0

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.

1 Comment

Your solution looks very interesting (at least for me) but I think not in this case
0

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

1 Comment

This is the case. A WebSetup project in Visual Studio does this automatically by the way.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.