2017-10-20 340 views
0

我正在嘗試使用免費託管在somee.com上部署示例網站。如何在somee.com上部署ASP.net網站?

首先我將我的網站發佈爲一個文件夾。我已經在本地機器上的IIS 7上的本地機器上進行了測試。這工作正常,沒有任何問題。

我創建了somee.com新的免費託管域,然後在文件管理器 - >

2.然後我做一個壓縮文件夾,我的網站上公佈的文件夾

然後我上傳的zip文件夾並選擇上傳並解壓縮檔案

4.現在,這是我的根文件夾中的文件結構

root folder structure

5.我希望它會運行default.aspx文件。然後我嘗試訪問我的網站,它拋出錯誤,如下面

錯誤味精

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b2d18bbc\3889fee\App_Web_home.master.cdcab7d2.cugbgmun.dll' -- 'Access is denied. '

Source Error:

[No relevant source lines]

注意

I created one small default.htm file for testing. If I upload that file. That's working fine.

的Web.config文件

<?xml version="1.0" encoding="utf-8"?> 

<configuration> 
    <system.web> 
     <customErrors mode="Off"/> 
     <compilation targetFramework="4.5" /> 
     <httpRuntime targetFramework="4.5" /> 
    </system.web> 
</configuration> 

如果我添加Default.aspx文件作爲啓動頁的Web配置如下圖所示,

<?xml version="1.0" encoding="utf-8"?> 

<configuration> 
    <system.webServer> 
     <defaultDocument> 
      <files> 
       <add value="Default.aspx" /> 
      </files> 
     </defaultDocument> 
    </system.webServer> 

    <system.web> 
     <customErrors mode="Off"/> 
     <compilation targetFramework="4.5" /> 
     <httpRuntime targetFramework="4.5" /> 
    </system.web> 
</configuration> 

錯誤味精

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

+0

在您添加默認文檔的Web配置的上一個版本中,您有索引。aspx而不是default.aspx。這是一個錯字還是你的問題? – Bearcat9425

+0

@ Bearcat9425對不起,我忘了改變我的問題。但在我的web.config文件中,它只有default.aspx的名字 –

回答

0

下面是步驟,將您的.NET發佈到服務器:

  1. 請使用Visual Studio工具打開您的項目
  2. 在解決方案資源管理器窗口(通常位於VS工具的右上角)上,右鍵單擊您的項目並選擇發佈
  3. 請將其發佈到本地文件夾,例如C:\ Project
  4. 請將您在C:\ Project上看到的任何文件/文件夾通過FTP上傳到服務器,您的網站將正常工作。

這些步驟將保持不變。如果您面臨500內部服務器錯誤,請詢問對方以檢查服務器上的完整錯誤消息。

+1

OP * did *提到了「* published *網站文件夾」,所以可能這已經完成了 –