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 :)

4

11 回答 11

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

于 2013-03-12T16:05:23.077 回答
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. :)

于 2013-03-15T06:32:29.297 回答
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 :)

于 2013-03-15T04:37:20.130 回答
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 !

于 2013-03-12T10:54:46.980 回答
0

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

于 2013-03-06T07:50:53.917 回答
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

于 2013-03-06T08:34:36.657 回答
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!

于 2013-03-12T16:20:30.850 回答
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
于 2013-03-14T06:55:12.310 回答
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.

于 2013-03-14T19:37:03.793 回答
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
于 2020-01-29T16:54:00.950 回答
-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.

于 2013-03-06T11:42:38.200 回答