.Net Framework Initialization Error – Unable to find a version of the runtime to run this applicatio

來源:互聯網
上載者:User

部署一個VS2010開發的程式時遇到 了一個非常奇怪的問題,用戶端上已經安裝了.net framework 4.0,但運行時還是會彈出錯誤:

.Net Framework Initialization Error – Unable to find a version of the runtime to run this application

查了一下,有人提供了這樣的解決方案,試了一下,成功:

修改Exe的Config檔案,一般是與exe同名,例如test.exe對應test.exe.config,在其中的<configuration>標籤內添加如下內容:

<startup>  <supportedRuntime version="v4.0.30319" /></startup>

當然,具體的版本號碼根據實際情況而修改

如果檔案夾下沒有Config檔案,自己建立一個也有效果,內容如下:

<configuration>  <startup>    <supportedRuntime version="v4.0.30319" />  </startup>
</configuration>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.