gpt4 book ai didi

.net-core - 找不到类型或命名空间名称 'DataException'

转载 作者:行者123 更新时间:2023-12-02 03:12:26 25 4
gpt4 key购买 nike

我在使用 .NET Core 1.0 时遇到以下编译错误:

“The type or namespace name 'DataException' could not be found (are you missing a using directive or an assembly reference?)”, code: CS0246.

项目.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?

最佳答案

关于.net-core - 找不到类型或命名空间名称 'DataException',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39185879/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com