2011-10-08 53 views
10

我更新了從3.5 NET到4.0版本,但更新程序集System.Web後不再工作。System.Web程序集.net 4.0版本中找不到

,我發現了以下錯誤:

Warning 1 Could not resolve assembly "System.Web". The assembly is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

使用3.5版本,它工作正常。我怎樣才能解決這個問題?

+1

以完整版本爲目標,而不是客戶端版本。 –

回答

17

變化從ClientProfile項目,以完整的.NET 4.0

The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. It provides functionality for most client applications, including Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features. This enables faster deployment and a smaller install package for applications that target the .NET Framework 4 Client Profile.

Differences between Microsoft .NET 4.0 full Framework and Client Profile

15

我認爲你已經選擇了.NET 4.0 Client profile作爲目標框架。只需切換到.Net 4.0

enter image description here

5

你靶向的.NET 4.0客戶端配置文件,這是一個.NET「精簡版」爲桌面用戶。轉爲完整.NET 4.0得到的的System.Web

項目屬性 - >應用程序選項卡 - >目標框架

4

嘗試將「目標框架」更改爲「.NET Framework 4」,而不是「.NET Framework 4客戶端配置文件」。

相關問題