23

I'm trying to deploy my website on somee.com but keeps getting this error

enter image description here

I've tried googling and it says I have to change my App Pool to ASP.NET 4.0. I've tried that already but with no luck:(

Informations:

-My site was coded in 4.0 Framework
-I'm using .NET Framework v4.0 Integrated
-I have checked needed things already in Windows Features
-Im using ASP.NET MVC3
-I already typed cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 then aspnet_regiis -ir to cmd
-64 bit OS

This is the steps how I publish my site

  1. First I manually added this things to my Reference then changed the Copy Local to True

    Microsoft.Web.Infrastructure
    System.Web.Helpers
    System.Web.Mvc
    System.Web.Razor
    System.Web.WebPages
    System.Web.WebPages.Deployment
    System.Web.WebPages.Razor

  2. I Editted this on my Web Config

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.0"/>
    <authentication mode="None"/>
    </system.web>
    </configuration>

  3. I add Deployable Dependencies that created _bin_deployableAssemblies which have this inside

    Microsoft.Web.Infrastructure.dll
    System.Web.Helpers.dll
    System.Web.Mvc.dll
    System.Web.Razor.dll
    System.Web.WebPages.dll
    System.Web.WebPages.Deployment.dll
    System.Web.WebPages.Razor.dll

  4. I then click Publish and have this settings

    This is how I Publish is this ok or I have to change something here? enter image description here

  5. I went to my IIS Manager. I right click on Default Web site Under Sites and choose Add Application with this settings enter image description here

  6. This resulted to this
    enter image description here enter image description here

  7. I went to C:/inetpub/wwwroot and sees this files
    enter image description here

  8. I then compressed it as zip then uploaded it in my account in somee.com then checked my site and now I'm getting the Configuration Error above.

    ABOVE IS MY UPDATED QUESTION I REPUBLISHED MY SITE AND INCLUDED STEPS HOW I PUBLISHED IT . I INCLUDED IT SO THAT YOU GUYS COULD SUGGEST IF I'M DOING SOMETHING WRONG ON HOW I'M PUBLISHING MY SITE AND COULD BE THE REASON OF THE ERROR ABOVE. THANKS IN ADVANCE :)


    My site works fine in the iis of the localhost of my machine it only gets that error when deployed on the internet. Btw I'm following the tutorials from these sites How to Deploy an ASP.NET MVC 3 App to Web Hosting with "\bin Deployment" Programming ASP.NET MVC 4 Chapter 19. Deployment Deployment ASP.NET MVC 3 project to IIS and somee

    Question: What could be the cause of this issue :( It's my first time to deploy a website on the internet. Hopefully you could help me guys.. If you need more info please tell me.

My IIS Manager enter image description here

My configuration enter image description here

or could this be the reason of my issue?

enter image description here


OK THIS PROBLEM WAS SOLVED. I FOUND OUT THERE'S NO PROBLEM ON MY SETTINGS. THE PROBLEM IS ON THE SETTINGS OF THE WEBHOSTING SITE. I CHANGED THE ASP.NET VERSION FROM 2.0 TO 4.0 BUT FORGOT TO CLICK THE UPDATE BUTTON :( I FEEL BAD I HAVEN'T REALIZED THAT. I'M NOW FACING ANOTHER ERROR BUT IT HAS NOTHING TO DO WITH THIS QUESTION. THANKS GUYS FOR TRYING TO HELP ME :)

  • 2
    So above shows you are deploying this not to the root but to a folder underneath it. What is your default site setup to run as? Is there anything there? In IIS is your application setup as an "application" or simply a folder - this could be the source of your issue. Right click on your app in IIS and ensure "Convert to application" isn't there - if it is, run it. Give that whirl – Adam Tuliper Mar 13 '13 at 06:51
  • It's running under DefaultAppPool. See my updated question I included some photos there. Maybe that could be the cause of the issue. –  Mar 13 '13 at 07:56
  • The above actually shows you are deploying to ProjectPAL, whats that folder look like in IIS? Post a screenshot of that right click menu. – Adam Tuliper Mar 13 '13 at 18:23
  • See my above photo. Its look like a shortcut folder. I cannot show the actual one I already convert it to application. T_T see my other photo. I think I'm uploading too many datas? –  Mar 14 '13 at 06:33
  • 1
    Lets keep this simple. Publish to your local file system. Remove everything on your server under your default website folder. copy everything into that root web folder. You've got all sorts of stuff in that root folder plus your projectpal. We want to deploy projectpal to the root, correct? – Adam Tuliper Mar 15 '13 at 04:30
  • can you paste the screenshot of whole page, where the error is showing? – Avishek Mar 15 '13 at 04:45
  • @Avishek see the updated error image –  Mar 15 '13 at 04:56
  • @Adam Tuliper yes I'm following. –  Mar 15 '13 at 04:57
  • Have you tried to repair .net framework 4, as it will register asp.net with IIS if something is missing – Satpal Mar 15 '13 at 05:10
  • @Satpal Singh could you tell me how to do it? thanks. Sorry this is my first time to deploy a website. I dont have much idea. :( –  Mar 15 '13 at 05:12
  • Control Panel >> Programs >> Uninstall a program >> Microsoft .NET Framework 4 >> Click on Repair [Note if you find more than 1 Microsoft .NET Framework 4] Use Microsoft .NET Framework 4 Multi Targeting pack – Satpal Mar 15 '13 at 05:17
  • 1
    @sxyback use these steps Control Panel >> Programs >> Uninstall a program >> Microsoft .NET Framework 4 Extended >> Click on Repair – Satpal Mar 15 '13 at 05:24
  • 1
    It is showing that your website is using framework 2.0 Try hosting it one more time and reset and restart all settings. Also refresh and restart the website after changing any settings. – Avishek Mar 15 '13 at 05:25
  • @Satpal Singh and Avishek thanks for your help guys. I found out what's the reason behind. I forgot to update the website version on somee.com. It's on default written on framework 2.0. :( my bad very bad. Im now facing new error which I'm already working on it. –  Mar 15 '13 at 06:11

11 Answers11

17

This typically happens when you have an attribute of targetFramework="4.0" in the web.config but the App Pool is set to run ASP.NET 2.0. The targetFramework attribute is entirely unrecognized by ASP.NET 2.0 - so changing it to 2.0 won't have the desired effect.

Contact Support / Your Administrator and have the AppPool switched to 4.0.

You could also remove the attribute entirely, however if your site was coded with the 4.0 Framework, then I'm sure something else will cause an error as well.

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

Community
  • 1
  • 1
MondayPaper
  • 1,569
  • 1
  • 15
  • 20
  • Yeah you got a point. But I'm the admin. I've tried that link already but seems no luck. See my updated question I've posted there the image of my IIS manager. It's seems my AppPool is already set to 4.0. –  Mar 13 '13 at 01:44
  • 1
    My issue was that while the AppPool was set to 4.0 the real issue was that 4.6.2 wasn't installed. After I installed 4.6.2 all is back to normal. HTH – c0d3p03t Mar 20 '18 at 00:36
10

I was now able to find reason behind the error guys. It's on the webhosting site settings not on my app pool or what so ever. I changed the asp.net version from 2.0 to 4.0 but I forgot to click the update button. I feel so embarrased. :( I've been struggling for days to fix this error and only to found out its on the webhosting site settings. GgrrRR.. As of now I'm facing new error but has nothing to do with this question. Anyway thanks guys for your efforts to help me. :)

  • So the image above was not from your hosted showing 4.0? Doh, I though lt those were your server screenshots – Adam Tuliper Mar 15 '13 at 07:36
  • Sorry its from the IIS Manager. The file manager in somee.com where Im uploading my files has different form and needs to set-up its settings manually. That's where I forgot to changed the asp.net version. –  Mar 15 '13 at 09:50
7

Try this, instead of selecting your websete's Application Pool to DefaultAppPool, select ASP.NET v4.0

Select your website in IIS => Basic Settings => Application Pool => Select ASP.NET v4.0

and you will be good to go. Hope it helps :)

Avishek
  • 1,896
  • 14
  • 33
1

Also try aspnet_regiis -u then aspnet_regiis -i on below path

C:\Windows\Microsoft.NET\Framework\v4.0.30319 

Now restart the IIS and check

Hope this will help !

vijay
  • 1,323
  • 1
  • 11
  • 15
  • thanks for your help. I tried you suggestion. But seems not working. Do I have to republish and reupload my data in the webhosting site after your suggestion? –  Mar 13 '13 at 02:00
  • No, republish is not required, but check for Framework selection in application pool one more time. Is it 4.0 integrated or not? – vijay Mar 14 '13 at 10:03
  • Yeah it is. Maybe there could be other reasons why I'm getting this error. –  Mar 15 '13 at 01:57
0

Have you tried the aspnet_regiis tool to register .Net 4.0 for IIS? You can check more at msdn

Patrick Jones
  • 1,896
  • 14
  • 26
Sergio
  • 6,900
  • 5
  • 31
  • 55
  • Yeah I type this command in cmd cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 then aspnet_regiis -ir but still it doesn't. :( –  Mar 06 '13 at 07:57
  • Could you try same thing with C:\windows\microsoft.net\framework\v4.0.30319? And Does it work under iis on your local machine? – Sergio Mar 06 '13 at 08:04
  • yeah it works fine on my local machine only when I deploy it on the internet it gets that error. What you are suggesting is a 32bit OS I'm using 64 bit and that command is the same. –  Mar 06 '13 at 08:11
  • ah doh, I just realized I wrote a similar comment up top after yours here for the 32 bit version (I should've read the comments more carefully!), if it works please give Sergio the points, although by all means please read the ref'd link above. – Adam Tuliper Mar 06 '13 at 08:46
0

You could be using the 32 bit version, so you should prob try at the command line from the Framework (not Framework64) folder.

IE Did you try it from C:\Windows\Microsoft.NET\Framework\v4.0.30319 rather than the 64 version? If you ref 32 bit libs you can be forced to 32 bit version (some other reasons as well if I recall)

Is your site a child of another site in IIS?

For more details on this (since it applies to various types of apps running on .NET) see Scott's post at:

32-bit and 64-bit confusion around x86 and x64 and the .NET Framework and CLR

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71
  • If I'll it do I have to re-publish / reupload my site? because when I tried it and just refreshed it doesnt work. Even if I'm using a 64bit OS is there a chance that I will be using a 32-bit version of Framework.? No this is the only site I'm publishing. –  Mar 06 '13 at 09:01
  • No shouldn't have to republish but if it still fails give it a try after or just change your web.config by adding a blank line at the end to force a recompile – Adam Tuliper Mar 06 '13 at 09:18
0

Make sure that you are building your web app as "Any CPU". Right click your web project --> Properties --> Build --> and look for the "Platform Target". Choose "Any CPU" or play around with it.

Hope this helps!

PM_ME_YOUR_CODE
  • 321
  • 1
  • 6
0

Each individual Web App under an IIS Web Site can use a different App Pool.

Verify the App Pool assigned to your app (not just the root site per your pictures) is .NET 4.0 compatible:

  1. Expand Default Web Site
  2. Right click on ProjectPALS, choose 'Manage Application' then 'Advanced...'
  3. Observe the 'Application Pool' your app is running as under the site
  4. Change to another App Pool if neccessary
geoffreys
  • 1,107
  • 7
  • 24
  • Thanks for your suggestion. It's set to DefaultAppPool which I'm using. –  Mar 14 '13 at 07:19
0

How are you running the application? Are you just hitting the website or are you building and running from within Visual Studio? If you are building and running you may want to tell it to use the local IIS web server. This would make sure it is using the App Pool you have set up to run with v4.0/integrated.

I am guessing that it is using the Visual Studio Development Server when running. This server is probably trying to run with the 2.0 framework. This then causes your error to be thrown.

Edit: To note, I normally just build my website application and then I attach to process w3wp when I want to debug. I do not use the publishing tool. Of course this means my local working directory is within the web root.

EthanTowne
  • 351
  • 4
  • 14
  • I'm already on the part that I'm uploading files on the web hosting site. Specifically on Somee.com. It works well in my localhost in IIS. When I'm trying to check my site on the internet it throws me that error. If I'm using Visual Studio Development Server how could I possibly changed that server? Could you please tell me the steps how are you publishing your site? thanks in advance. Because this could also be the reason. –  Mar 15 '13 at 01:52
0

My problem was solved that way:

Your username is probably restricted, You must grant full access to the user.

  1. Right Click on Project and select Properties
  2. Click on Tab Security
  3. Click Edit button
  4. Found Current User and Permission for User Allow Full Control
ChrisMM
  • 8,448
  • 13
  • 29
  • 48
-1

If your application is 32 bit, and you want to deploy in a 64 bit machine, You need to set 'Enable 32 Bit Applications' property to 'True' in the application pool - advanced settings.

amesh
  • 1,311
  • 3
  • 21
  • 51