views:

250

answers:

2

Hi,

I have MOSS 2007 installed at lets say http://localhost:4999/ and I want to have my custom ASP.NET MVC (1.0) application at http://localhost:4999/mvcapp/ - logic dictates that, in IIS, i should create a new application virtual directory under my MOSS site and point it at my custom MVC app.

I've done this and it works for executing my controllers etc, however, none of my /Content content is being returned! All referenced images, javascript and css aren't retrieved.

If I put this app into it's own site, or a virtual application within a non-sharepoint site, this works fine and pulls down the images, js and css as normal.

Note - I'm creating a new application in IIS, not just a virtual directory and I have no requirement for integrating with sharepoint, I just want it to have the same domain and port number.

Any ideas?

Cheers Tony

** EDIT ** To clarify - the URL's that are being generated aren't the issue - they are correct and are being generated in the same way as they would be if this wasn't hosted under sharepoint. IE: /mvcapp/Content/Scripts/jquery.js etc.

** EDIT 2 ** More clarification - the MVC app has it's own web.config file - but it appears that when using a virtual directory withn a sharepoint site, many of the handler mappings still get pushed up to the child site (Note: This is a virtual directory configured as a seperate application not just a virtual directory).

Whilst I don't want or need SharePoint integration, I need my MVC app to come from the same domain and port to overcome some cross domain issues (a lot of MVC content is iframed into sharepoint in various ways). So sharepoint would be at http://site and my app at http://site/mvc

+1  A: 

I would keep them on separate web sites (MVC and SharePoint that is). You could create a new website entirely for your MVC app, and then through IIS, right click your MVC web site, edit bindings, and redirect the traffic from your MVC website to URL you want.

Hugo Migneron
Does your Virtual Directory have its own web.config file? If not then it will be picking up the parent web apps (sharepoints's) config
Ryan
He mentioned that he doesn't need to / wish to integrate with SharePoint so there is probably no need for him to share the web.config file. With one config for each app it should work well.
Hugo Migneron
Yes, it has it's own web.config file - but it appears that when using a virtual directory withn a sharepoint site, many of the handler mappings still get pushed up to the child site (Note: This is a virtual directory configured as a seperate application not just a virtual directory).Whilst I don't want or need SharePoint integration, I need my MVC app to come from the same domain and port to overcome some cross domain issues (a lot of MVC content is iframed into sharepoint in various ways). So sharepoint would be at http://site/ and my app at http://site/mvc/
deepcode.co.uk
+1  A: 

I set up a couple of WebForms apps to run in much the same way you say that you want: a separate virtual application with its own web.config, etc. I had to tweak the web.config to make it work, though. My app uses things like session state and view state, but I reckon those aren't applicable to your MVC app. As I look at my web.confing, I think this section might be applicable for what you're trying to do:

<location>  
  <system.web>  
    <xhtmlConformance mode="Legacy" />  
    <trust level="Full" />  
    <httpModules>  
      <remove name="PublishingHttpModule" />
    </httpModules>  
  </system.web>  
</location>

Hope that helps. I also have an <authorization> section in there, but it wasn't necessary to make the app work.

Abs
Tried that and the app is still working, but the CSS/JS and images etc are still not being served down. I think this is specific to MVC apps in a virtual application under sharepoint.... If I go into IIS and remove the handler mapping for something called "AboMapperCustom-91701" then the content comes through correctly. Can't just remove this in web.config though as the name is different on every machine....
deepcode.co.uk