找不到类型或命名空间名称“DataException”

时间:2016-08-27 21:24:21

标签: .net-core

我使用.NET Core 1.0获得以下编译错误:

  

“找不到类型或命名空间名称'DataException'(您是否缺少using指令或程序集引用?)”,代码:CS0246。

project.json

 {
  "name": "Dna.Net.Core",
  "version": "1.0.0-*",

  "dependencies": {
    "Autofac": "4.1.0",
    "NETStandard.Library": "1.6.0",
    "System.Data.SqlClient": "4.1.0",
    "System.Runtime": "4.1.0",
    "System.Runtime.Serialization.Formatters": "4.0.0-rc3-24212-01",
    "System.Runtime.Serialization.Primitives": "4.1.1"
  },

  "frameworks": {
    "netstandard1.6": {
      "imports": "dnxcore50"
    }
  }
}

corefx: System.Data.SqlClient

48  <Compile Include="System\Data\DataException.cs" />

IDataExceptionMessageHandler.cs

using Dna.Net.Core.Common;
using System.Data;

namespace Dna.Net.Core.Exceptions
{
    public partial interface IDataExceptionMessageHandler
    {
        CustomMessage Execute(DataException exception);
        CustomMessage ParseMessage(DataException exception, CustomMessage customMessage);
        void LogException(string message);
    }
}

.NET Core 1.0是否支持System \ Data \ DataException.cs?

1 个答案:

答案 0 :(得分:1)