我使用.NET Core 1.0获得以下编译错误:
“找不到类型或命名空间名称'DataException'(您是否缺少using指令或程序集引用?)”,代码:CS0246。
{
"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"
}
}
}
48 <Compile Include="System\Data\DataException.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?
答案 0 :(得分:1)
该文件存在,但它没有DataException类 - https://github.com/dotnet/corefx/blob/master/src/System.Data.SqlClient/src/System/Data/DataException.cs
它不支持。