本文介绍了类型或命名空间名称'交易'不命名空间中的'系统'存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是在ASP.Net Web应用程序,使用Visual Studio 2013的解决方案是由几个项目。我有code库中的项目,该项目具有使用System.Transactions的,它的数月运作良好。

This is in an ASP.Net web application, with Visual Studio 2013. The solution is composed of several projects. I have code in a library project that has using System.Transactions, and it's worked well for months.

今天我加的Web应用程序项目相同的使用System.Transactions的在code和失败与以下错误信息:

Today I added the same using System.Transactions in code in the web application project, and it fails with the error message below:

The type or namespace name 'Transactions' does not exist in the namespace 'System'

下面有几件事情我已经试过:

Here are a few things I've tried:

  • 添加引用 System.Transactions的
  • 验证所引用的dll文件是在这两个项目中的相同。
  • 改变框架4至4.5和背部。
  • 在确认所有项目都使用相同的架构版本。
  • 清理和重建的解决方案。
  • 退出Visual Studio中,删除的应用程序数据的所有文件>本地>温度,重建。
  • 重新启动电脑。
  • Added a reference to System.Transactions.
  • Verified that the referenced dll file is the same in both projects.
  • Changed the framework from 4 to 4.5 and back.
  • Verified that all projects are using the same framework version.
  • Cleaned and rebuilt the solution.
  • Quit Visual Studio, deleted all files in AppData>Local>Temp, rebuilt.
  • Restarted the PC.

所以,结果是使用System.Transactions的在一个项目中工作正常,但不是另一个,即使这两个项目都在同一个解决方案。

So, the upshot is that using System.Transactions works fine in one project but not another, even though both projects are in the same solution.

有什么建议?

编辑:下面是一个怪胎这可能不是任何额外的帮助,但这里有云:

Here's an oddity that's probably not any additional help, but here goes:

  • 当我生成项目,没有错误。也就是说,使用System.Transactions的编译就好了。
  • 如果我运行的应用程序,它的炸弹,并显示在浏览器窗口中的错误。该VS code窗口仍然显示没有错误。
  • 如果我编辑使用System.Transactions的或加code像变种X =系统... ,错误会立即出现在使用System.Transactions的
  • When I build the project, there are no errors. That is, the using System.Transactions compiles just fine.
  • If I run application, it bombs and the error appears in browser window. The VS code window still shows no errors.
  • If I edit the using System.Transactions or add code like var x = System..., the errors immediately appear in the using System.Transactions.

推荐答案

请参阅本Answer马克厅

有一个 Microsoft Connect上发布入境这一点。有一种意见是建议,你可以浏览它。给出的路径是:

C:\ Program Files文件(x86)的\参考大会\微软\ Framework.NETFramework \ V4.5 \ System.Transactions.dll

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Transactions.dll

只需添加引用浏览到这条道路

Just Add reference by browsing to this path

如果这没有工作,去参考 - > System.Transactions的,并确保在认为复制本地设置为True的属性此参考

if this did not work, Go to References -> System.Transactions and make sure on the properties for this reference that "Copy Local" is set to True.

这篇关于类型或命名空间名称'交易'不命名空间中的'系统'存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:21
查看更多