腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
ASP.NET
核心
GetConnectionString
不
工作
asp.net-core
、
connection-string
、
dbcontext
我是ASP NET
核心
的新手,我正在编写新的web API。我无法从appsettings.json文件中检索连接字符串,并且我得到了一个ArgumentNullException。services.AddMvc(); services.AddDbContext<MyDBContext>(options => options.UseSqlServer(Configuration.
GetConnectionString
浏览 7
提问于2019-02-27
得票数 0
1
回答
Azure函数-如何在app.config中添加我的数据库连接字符串
c#
、
azure-functions
使用Azure函数中的app.config和C#获取DB字符串。var Conn = ConfigurationManager寻找一种利用conn字符串实现数据库控制的好方法。
浏览 4
提问于2021-12-28
得票数 0
回答已采纳
1
回答
为什么在every中的每个api调用之后,DbContext都会自动处理?
c#
、
asp.net-core
、
entity-framework-core
、
repository-pattern
、
asp.net-core-webapi
MyDbContext>();{ options.UseSqlServer(Configuration.
GetConnectionString
浏览 0
提问于2017-08-17
得票数 0
回答已采纳
1
回答
ASP.NET
核心
5到
ASP.NET
核心
6的迁移
asp.net-core
、
asp.net-core-mvc
我以模块化的方式实现了我的项目,也是从洋葱体系结构中实现的,正如您在代码中看到的,在
ASP.NET
核心
5中,我做了以下
工作
,在启动时向内核介绍一个模块。我的问题是:我想使用
ASP.NET
核心
6。public void ConfigureServices(IServiceCollection services) var connectionstring = Configuration.
GetConnectionString
浏览 3
提问于2022-11-12
得票数 0
1
回答
在
ASP.NET
Core 6 Program.cs中配置EF
c#
、
asp.net
、
asp.net-core
、
asp.net-web-api
、
entity-framework-6
我被要求制作一个
ASP.NET
Core 6 webAPI,我以前没有使用微软产品的经验,我在文档中跟踪MS Docs ,他们教我如何用Main方法在Startup.cs文件中配置EF (他们忘记更新文档了吗,这个文档不在
ASP.NET
Core 6中,My Program.cs没有Main方法,如下所示: var builder = WebApplication.CreateBuilder(args);
浏览 3
提问于2022-03-08
得票数 1
回答已采纳
2
回答
在其他.NET类库中使用DbContext
asp.net-core
、
entity-framework-core
、
.net-core
我正在使用
ASP.NET
核心
与EF
核心
代码首先。我在我的
ASP.NET
核心
项目的Startup.cs的服务配置中定义了DbContext的依赖注入,如下所述(): options.UseSqlServer(Configuration.
GetConnectionSt
浏览 1
提问于2016-08-22
得票数 1
2
回答
无法访问已释放的上下文实例EF
核心
。
c#
、
database
、
entity-framework
、
asp.net-core
、
dependency-injection
我正在用.net
核心
mvc和EF开发一个客户关系管理系统,它需要大量的数据库连接来检索和更新信息。在调试过程中,我不时会遇到这个错误,这是一个有很多用户的大项目,我不知道它在实际使用中会如何
工作
!services.AddDbContext<XXX> option.UseSqlServer(Configuration.
GetConnectionString
services.AddDbContext<XXX>
浏览 5
提问于2021-03-27
得票数 3
回答已采纳
1
回答
引用类库中的注入?
c#
、
.net
、
asp.net-core
、
code-injection
我有一个
ASP.NET
核心
2.1网站,它引用类库(DAL)。要从appsettings.json(
ASP.NET
项目)访问连接字符串,我需要以某种方式注入配置。(IConfiguration configuration) Configuration = configuration; public string
GetConnectionString
(string name) return Configuration.
GetConnectio
浏览 1
提问于2019-02-18
得票数 0
回答已采纳
3
回答
“转到实现”以“符号没有实现”结尾。
c#
、
visual-studio
、
asp.net-core
、
.net-core
services.AddDbContext<RazorPagesMovieContext>(options =>是否有可能使Go To Implementation
工作
,因为.NET
核心
和
ASP.NET
浏览 0
提问于2019-05-30
得票数 2
1
回答
在向服务添加DbContext之前,我可以从容器中获取服务吗?
c#
、
asp.net-core
、
entity-framework-core
、
asp.net-core-3.1
我有一个基于
ASP.NET
核心
3.1的应用程序。services) services.AddDbContext<AppDbContext>(scope => scope.UseMySql(Configuration.
GetConnectionString
("ConnectionString"));} 但是,在这种情况下,我尝试使用构建在
核心
3.1框架之上的
ASP.NET
。=
浏览 0
提问于2020-06-26
得票数 2
回答已采纳
1
回答
asp.net
核心
2.0: connString与'microsoft.entityframeworkcore.dbcontext‘
不
兼容,因为它是一个字符串。反正是为了让它们兼容?
c#
、
.net
、
entity-framework
、
asp.net-web-api
、
asp.net-core-2.0
我正在将c#的web应用程序从
ASP.Net
内核1.x改为
ASP.Net
核心
2.0。class Greetcontext : DbContext public Greetcontext(string connString) : base(connString){}在以前的
asp.net
内核1.x中,上面的代码运行得很好,但是在转换为
asp.net
内核2.0时,我遇到了一个问题,即connectionString由于Microsoft.EntityFrameWorkCore而不能成为字符串
浏览 0
提问于2017-10-17
得票数 0
回答已采纳
1
回答
到EF6数据库上下文的
asp.net
核心
web应用程序错误连接
entity-framework-6
、
asp.net-core-2.0
我正尝试在我的
asp.net
核心
2.0Web应用程序中使用这个dbcontext。有人能帮上忙吗?modelBuilder.Entity<Sample>() .IsUnicode(false);}我在
asp.net
浏览 0
提问于2018-02-07
得票数 0
1
回答
未使用ADO和NET5.0初始化ConnectionString属性
sql-server
、
asp.net-core
、
stored-procedures
、
controller
、
ado.net
我正在使用VS 2019,Server 2016,我尝试使用ADO.NET更新注册表,但我得到了一个错误:控制员:con = new SqlConnection(ConfigurationManager.ConnectionStrings["DevConnection"].ConnectionString);Object reference not set to an instance of an object.'con = new SqlConnection(appSe
浏览 2
提问于2022-02-16
得票数 0
回答已采纳
1
回答
在控制台应用程序中使用EF
核心
进行NInject和迁移
.net-core
、
ef-core-2.0
我使用NInject容器进行依赖注入,使用实体框架
核心
作为对象模型。
浏览 0
提问于2019-04-23
得票数 0
2
回答
如何在我想要的地方获取DbContext
核心
2.0中的
ASP.NET
实例?
c#
、
entity-framework
、
asp.net-core
、
dependency-injection
如何在我想要的地方获取DbContext
核心
2.0中的
ASP.NET
实例?要连接DataBase,我使用了服务services.AddDbContext
浏览 0
提问于2019-05-13
得票数 2
回答已采纳
1
回答
ASP.Net
核心
web应用上的.config文件和Azure设置之间的混淆
azure
、
asp.net-web-api
我已经构建了一个项目(为SPA web应用程序提供应用程序接口)作为
Asp.Net
核心
Web应用程序(.net框架),并使用WebApi选项(VS 2017社区)。这将创建一个包含app.config文件而
不
包含web.config文件的项目。Startup.cs类中使用System.Configuration.ConnectionManager.ConnectionStrings['MainDb']阅读了app.config中的一节,它在本地
工作
得很好
浏览 10
提问于2017-07-12
得票数 1
回答已采纳
1
回答
无法将lambda表达式转换为“InjectionMember[]”类型,因为它不是委托类型。-如何在MVC应用程序中使用DI
c#
、
asp.net-mvc
、
asp.net-mvc-4
、
dependency-injection
、
unity-container
我编写了
asp.net
核心
应用程序,并使用下面的代码进行依赖注入,它运行得很好。("Table_StorageAccount"), tableName: Configuration.
GetConnectionString
("Table_TableName")));由于某些原因
浏览 0
提问于2018-04-26
得票数 0
1
回答
向.Net Core2.0角模板添加身份验证
angular
、
authentication
、
asp.net-identity
、
asp.net-core-2.0
我正在尝试用.Net
核心
2.0角模板实现身份验证(在VisualStudio2017中)。我尝试使用
asp.net
身份试图跟随 options.UseSqlServer(Configuration.
GetConnectionString
))); services.AddDbContext<EduSmartContext>(
浏览 0
提问于2018-02-19
得票数 1
1
回答
将MYSQL与
asp.net
核连接时出错
mysql
、
repository-pattern
、
asp.net-core-2.0
问题startup.csservices.AddDbContext<MyContext>(options =>options.UseMySQL( Configuration.
GetConnectionString
("DefaultConnection"),
浏览 3
提问于2017-12-05
得票数 1
回答已采纳
1
回答
重新加载/重新启动
ASP.NET
Core2.1Web应用程序
c#
、
datacontext
、
asp.net-core-2.1
services.AddDbContext<ApplicationDbContext>(options =>
浏览 4
提问于2019-03-03
得票数 1
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
Asp.Net Core 2.1+的视图缓存
在.NET Core类库中使用EF Core迁移数据库到SQL Server
ASP.NET Core值得学吗?
ASP.NETCore的Kestrel服务器
ASP.NET Core 的Kestrel服务器
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券