Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using a free web host (0000free) which supports ASP.NET MVC, but it uses Mono. This is the first time I deploy an MVC application, so I'm a little confused as to where I need to deploy it. I have Visual Studio 2010 and I used its Publish Feature (i.e. right click on the project name and click publish) and I tried several things:

  1. Publish method: FTP to the root folder.
  2. Publish method: FTP to the publich_html folder.
  3. Publish method: File System to the root folder.
  4. Publish method: File System to the publich_html folder.
  5. Publish method: File System to a local directory on my computer and then FTP to root and also tried the public_html folder.
  6. I went into the cPanel (control panel) to try and see if ASP.NET has to be added/enabled for my web site, but I didn't see anything there.
  7. I can't browse to Index.aspx nor can I redirect to it from index.html (as suggested from other posts on the host forum), right now I have a link from index.html to Index.aspx but it's not working either (see http://www.mydevarmy.com)
  8. I've also tried renaming Index.aspx to Default.aspx, but that doesn't work either.

The search utility of the forum of the host is somewhat weak, so I use google to search their forum: http://www.google.com/search?q=publish+asp.net+site%3A0000free.com%2Fforum%2F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

I've been reading Pro ASP.NET MVC Framework and they have a chapter about publishing, but it doesn't provide any specific information with respect to the location of publishing, this is all they say (and it's not very helpful in my case):

Where Should I Put My Application?
You can deploy your application to any folder on the server. When IIS first installs, it automatically creates a folder for a web site called Default Web Site at c:\Inetpub\wwwroot\, but you shouldn’t feel any obligation to put your application files there. It’s very common to host applications on a different physical drive from the operating system (e.g., in e:\websites\ example.com). It’s entirely up to you, and may be influenced by concerns such as how you plan to back up the server.

Here is the exception I get when I try to view my Index.aspx page:

Unrecognized attribute 'targetFramework'. (/home/devarmy/public_html/Web.config line 1)

Description: HTTP 500. Error processing request.

Stack Trace:

System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'targetFramework'. (/home/devarmy/public_html/Web.config line 1)
  at System.Configuration.ConfigurationElement.DeserializeElement (System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationSection.DoDeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in <filename unknown>:0 
  at System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection (System.String sectionName) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.get_CompilationConfig () [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
share|improve this question

2 Answers 2

up vote 2 down vote accepted

the "Unrecognized attribute 'targetFramework" means that your build is targeting a framework that isn't supported by the server. An example is if the server only supports <=3.5 and your build targets .Net 4.0, this will generate that error. So first thing is double check what your .Net version is targeting and what version the server supports.

share|improve this answer
    
@Lirik , i think MVC has versions lower than 3.5. but also keep in mind that if your server has .Net 2.0 installed that doesn't mean that it can only run .Net 2.0 compiled applications, it isn't straight forward like that. I'd contact the customer support of who ever your hosting with. –  Letseatlunch Feb 18 '11 at 23:02
    
my head is about ready to explode, I've been at this for the entire day! It's a free host, so it's hard to get support... I guess that's the price we have to pay for freedom :). –  Lirik Feb 18 '11 at 23:07
    
@Lirik lol sorry yo. –  Letseatlunch Feb 18 '11 at 23:19
    
@Letseatlaunch I decided to change my host... paid $84 for 2 year hosting at Arvixe (which supports ASP.NET MVC). –  Lirik Feb 19 '11 at 2:03

What version of MVC is your app written against? Mono currently only supports ASP.NET 1.1 and most of 2.0 so if your app targets a higher framework it's going to have problems. Also, Mono does not yet support MVC3, so if you're using it you'll have to rethink things.

Also, have a look here for porting an MVC app to Mono.

share|improve this answer
    
I built it against .NET 4.0, and MVC applications are not supported under 3.5... if I port it to Mono, then do I still deploy to public_html? –  Lirik Feb 18 '11 at 22:58
    
@Lirik Yes, if that's the doc root for your site. –  squillman Feb 18 '11 at 23:01
    
thanks... I'll try porting it now. –  Lirik Feb 18 '11 at 23:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.