【发布时间】:2019-11-02 11:51:29
【问题描述】:
我有一个网络应用程序,它使用asp.net mvc 和使用Enterprise Library 的数据访问。项目运行良好。但我已经设置了VSTS DevOps。然后它构建它并显示错误
错误 CS0234:命名空间“Microsoft.Practices.EnterpriseLibrary”中不存在类型或命名空间名称“Data”(您是否缺少程序集引用?)
我的代码
using NewsHub.Domain;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewsHub.Data
{
public class FeedbackRepository : IFeedbackRepository
{
Database db;
DbCommand cmd;
DbCommand cxd;
DbConnection con;
DbTransaction transaction;
public FeedbackRepository()
{
DatabaseProviderFactory factory = new DatabaseProviderFactory();
db = factory.Create("NewsHubConString");
con = db.CreateConnection();
}
public List<FeedbackDTO> GetAllFeedbacks()
{
List<FeedbackDTO> _feedback = new List<FeedbackDTO>();
try
{
con.Open();
// Some code goes here
}
catch (Exception ex)
{
throw;
}
return _feedback;
}
}
}
【问题讨论】:
-
这不能解决您的问题,但该库不再处于开发阶段。我会避免它。你需要它做什么?
-
如果 dll 已下载,您能否检查 nuget 还原日志?
-
@WilliamXifaras 我已经使用 Enerprise 库连接了我的数据库。那么如何避免呢?
-
@ShaykiAbramczyk 日志在哪里?
-
在构建摘要中
标签: c# asp.net asp.net-mvc azure azure-devops