2010-06-05 94 views
6

我有一個很大的vb.net web項目,我試圖升級到.net4/VS2010。在編譯期間,我收到以下錯誤:MembershipUser/System.Web.ApplicationServices在升級到.NET時出現問題4

'System.Web.Security.MembershipUser' in assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has been forwarded to assembly 'System.Web.ApplicationServices'. Either a reference to 'System.Web.ApplicationServices' is missing from your project or the type 'System.Web.Security.MembershipUser' is missing from assembly 'System.Web.ApplicationServices'.

我研究了這個問題,錯誤是準確的。我添加了對System.Web.ApplicationServices的引用,但我仍然遇到問題。該項目似乎沒有認識到該參考文獻已被添加。智能感知不會把它撿起來,我不能在import語句使用它,等...

組件在我的web.config的編譯部分中列出:

<assemblies> 
... 
    <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
</assemblies> 

任何想法?

回答

2

我最近將一個項目從3.5升級到4.0,並收到上面定義的錯誤。我發現target.framework屬性未包含在web.config中的編譯節點上。這解決了我編譯錯誤的問題。

compilation debug="false" strict="false" explicit="true" **targetFramework="4.0"** 
+0

這樣做對我來說也是如此,同時還將中的VB/C#CompilerVersions更改爲v4.0。謝謝! – MisterZimbu 2011-11-18 14:57:42

1

添加對System.Web.Extensions.dll的引用,然後嘗試。

+0

我已經在參考文獻中有這個。刪除並重新添加。沒有運氣。 – DaveK 2010-06-07 16:56:52

-1

Web.config的編譯部分中指定的PublicKeyToken = 31BF3856AD364E35與請求的(PublicKeyToken = b03f5f7f11d50a3a)不同。看一下這個。

+1

-1:PublicKeyToken 31BF3856AD364E35對於System.Web.ApplicationServices是正確的。 b03f5f7f11d50a3a是System.Web的PublicKeyToken。 – MisterZimbu 2011-11-18 14:45:42

7

檢查其中依賴的項目是否也引用System.Web.ApplicationServices。

+0

在.net 4.0 visual studio 2012課程項目中爲我工作 – hanzolo 2012-09-25 07:13:42

相關問題