Asp .NET核心1.1错误 [英] Asp .NET core 1.1 error

查看:81
本文介绍了Asp .NET核心1.1错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP .Net Core 1.1应用程序,该应用程序工作到2周前。我今天打开了应用程序并收到以下错误。



'WebHostBuilder'不包含'UseKestrel'的定义,也没有扩展方法'UseKestrel'接受第一个参数可以找到'WebHostBuilder'类型(你是否错过了使用指令或汇编引用?)







'DbContextOptionsBuilder'不包含'UseSqlServer'的定义,也没有扩展方法'UseSqlServer'接受类型'DbContextOptionsBuilder'的第一个参数(你是否缺少using指令或汇编引用?)



我一整天都在谷歌上,仍然没有解决方案。

请协助。



我的尝试:



再次添加NuGet包。

I have a ASP .Net Core 1.1 application which worked up till 2 weeks ago. I opened the application today and get the following errors.

'WebHostBuilder' does not contain a definition for 'UseKestrel' and no extension method 'UseKestrel' accepting a first argument of type 'WebHostBuilder' could be found (are you missing a using directive or an assembly reference?)

And

'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no extension method 'UseSqlServer' accepting a first argument of type 'DbContextOptionsBuilder' could be found (are you missing a using directive or an assembly reference?)

I have been on Google, the whole day and still do not have a resolution.
Please Assist.

What I have tried:

Adding the NuGet packages again.

推荐答案

没有你实际告诉你已经尝试过的东西(除非重新安装nuget真是你所做的全部)我我会捅它。快速谷歌搜索看起来像你的问题DbContextOptionsBuilder缺少 Microsoft.EntityFrameworkCore.SqlServer 参考。



< a href =https://www.google.com/search?q=%27DbContextOptionsBuilder%27+does+not+contain+a+definition+for+%27UseSqlServer%27+and+no+extension+method+%27UseSqlServer%27 +接受+ a +第一个+参数+ +类型+%27& ie = utf-8& oe = utf-8>'DbContextOptionsBuilder'不包含'UseSqlServer'的定义,也没有扩展方法'UseSqlServer'接受第一个Google搜索类型的参数[ ^ ]



UseSqlServer()方法在Microsof中缺少t.EntityFrameworkCore.SqlServer 1.1.1·问题#7891·aspnet / EntityFramework·GitHub [ ^ ]



红隼问题看起来您可能需要确保您的projects.json文件具有正确版本的红隼参考。



upntu 16.04上的Asp.net核心问候世界 - Stack Overflow [ ^ ]



如果你发誓说你已经重新安装了引用并拥有kestrel / sql server然后您需要检查您的版本并确保您没有版本不匹配。例如,您的应用程序是.net核心1.1并且正在寻找1.1版本的所有版本,但是当您安装/重新安装您的sql server / kestrel时,引用可能是2.0,您需要将所有版本升级到相同版本或者降级sql server / kestrel引用1.1。
Without you actually telling what you've tried (unless reinstalling nuget is truly all you've done) I'll take a stab at it. A quick google search looks like your issue for DbContextOptionsBuilder is missing the Microsoft.EntityFrameworkCore.SqlServer reference.

'DbContextOptionsBuilder' does not contain a definition for 'UseSqlServer' and no extension method 'UseSqlServer' accepting a first argument of type ' - Google Search[^]

UseSqlServer() method is missing from Microsoft.EntityFrameworkCore.SqlServer 1.1.1 · Issue #7891 · aspnet/EntityFramework · GitHub[^]

The kestrel issue looks like you may need to make sure your projects.json file has the correct version of kestrel reference.

Asp.net core hello world on ubuntu 16.04 - Stack Overflow[^]

If you swear up and down that you've reinstalled your references and have the kestrel/sql server then you need to check your versions and make sure you don't have version mismatches. For example, your app is .net core 1.1 and is looking for all versions at 1.1 but when you've installed/reinstalled your sql server/kestrel references may be at 2.0 and you either need to upgrade everything to same version, or down grade the sql server/kestrel references to 1.1.


这篇关于Asp .NET核心1.1错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆