![](/img/trans.png)
[英]CS0234 C# The type or namespace name 'Slydeextender' does not exist in the namespace (are you missing an assembly reference?)
[英]The type or namespace name 'Transactions' does not exist in the namespace 'System' (are you missing an assembly reference?) - C# ASP.NET
我們有一個使用System.Transactions命名空間的C#ASP.NET Web應用程序。
using System.Transactions;
這在本地開發時工作正常 - 我們只需要首先通過網站添加引用 - >添加引用...
問題是在部署到Web主機(通過FTP復制)后,主機不知道此引用。
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: CS0234: The type or namespace name 'Transactions' does not exist in the namespace 'System' (are you missing an assembly reference?)
在Visual Web Developer Express 2010中工作,我們沒有內置的References文件夾。我看到了這個解決方案: https : //stackoverflow.com/a/13035466/2178080建議(但不建議)將dll復制到應用程序文件夾。
我有點新的部署ASP,不知道如何包含System.Transactions庫,以便主機可以找到引用。 有沒有人遇到過這個問題?
編輯:我們采用了將dll與應用程序一起復制到站點的路徑。 執行此操作的步驟:
由於此解決方案被列為不推薦,我仍然對其他解決方案持開放態度。
Edit2: Grant和Chris幫助我理解我正在使用Web站點而不是Web應用程序。 Grant幫助解決了網站問題的具體細節。
您的問題是由於發布的網站沒有帶System.Transactions.dll,這指向“復制本地”設置為False,因此DLL不會復制到bin文件夾。
轉到References -> System.Transactions
並確保此引用的屬性“Copy Local”設置為True 。
檢查IIS中的目標框架,確保它設置為您正在編譯代碼的.Net版本。如果您使用的是具有應用程序池的IIS 7+,請確保運行應用程序的池是相同版本的.Net。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.