简体   繁体   中英

not able to publish asp.net website

I've designed a website using ASP.NET web-forms in visual studio 2013, i published the website using BUILD-> Publish selection and i used FTP publish method. publishing was successful , but when i type website address the following error happens :

错误

and this is my web.config file :

<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
 http://go.microsoft.com/fwlink/?LinkId=169433
 -->

 <configuration>
 <system.web>
  <compilation debug="true" targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" />
< /system.web>

please help me to run my webstie.

UPDATE: modification to web.config file has been done as the screen says, after that this error happended: 在此处输入图片说明

UPDATE: after targeting to .NET framework 4.0 this error happens : 在此处输入图片说明

It seems that your localhost has 4.5 installed and your project targets .NET 4.5.

Install .NET framework 4.5 to your server, or target your project in .NET 4.0 provided that your server has .NET 4.0 installed.

Follow this link to see how you can change the target framework for your project : LINK

Make sure that you have configured the IIS application pool to use the correct version of the .NET framework.

If you do not have 4.5 there you have to install it.

If you can try downgrading to like 4.0 for example.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".

<configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM