我试图放弃使用 VS 2013 并在 VS 2019 中运行/调试我们的应用程序。这是一个使用 EF6(代码优先)的 MVC 5 应用程序(.NET 4.7.2)。我可以启动它并加载一个页面。问题是,当需要时加载实体时,它似乎无法加载子对象或集合。大多数情况下,我们会从已加载的实体中延迟加载每个子项。它们始终为空。即使单步执行此操作并将实体放入手表中,当我查看其上的任何子对象或集合属性时,它也会显示以下错误消息:
“‘EntityFrameworkDynamicProxies-[这里是我的项目名称]’的元数据无效。如果您正在调试小型转储,则可以通过使用堆收集新的小型转储并再次评估表达式来解决此问题。”
...尽管我不确定这与它们在手表中查看或悬停在它们上方时未加载有什么关系。我们也没有使用 EDMX 或类似的东西,所以我不确定它在那里做什么。奇怪的是,我们在 devops 中的构建无论如何都使用 VS 2017 来构建它(尽管我想在开发中并最终构建,移至 2019),并且我们在生产中运行它没有遇到问题。谢谢!
我在启动(asp.net core 2.2 proj)中有以下内容:
public Startup(IConfiguration configuration, IHostingEnvironment environment)
{
Configuration = configuration;
Environment = environment;
new ConfigurationBuilder()
.SetBasePath(Environment.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true)
.AddEnvironmentVariables()
.Build();
}
public void ConfigureServices(IServiceCollection services)
{
var appSettings = new AppSettings();
Configuration.Bind("appSettings", appSettings);
services.AddSingleton(appSettings);
....
}
Run Code Online (Sandbox Code Playgroud)
我已设置值来覆盖 appsettings.json 中的所有应用程序设置值,但我的应用程序服务仍在使用 appsettings 中的内容,而不是我在门户中放置的内容。根据文档,应用程序服务的这些门户应用程序设置应覆盖 appsettings.json 文件并改为使用。我是不是少了一步?
谢谢
编辑:
即使将启动更改为以下内容也不会选择我的天蓝色应用程序设置:
public Startup(IConfiguration configuration, IHostingEnvironment environment)
{
Configuration = configuration;
Environment = environment;
Configuration = new ConfigurationBuilder()
.AddConfiguration(configuration)
.SetBasePath(Environment.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true)
.AddEnvironmentVariables()
.Build();
}
Run Code Online (Sandbox Code Playgroud) 我有一个问题,我试图用我自己的颜色覆盖twitter bootstrap(v 2.0.3)主按钮,它在IE中工作正常,但在FireFox或Chrome中没有.所以在我的页面上,我首先链接到bootstrap.css,然后在那之后,我链接到我自己的样式表,它有我自己的更改.现在,我的类被命名为与引导程序相同,但我认为我的样式优先,因为我的样式表在引导程序之后链接到:
<link href="~/Content/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="~/Content/mystyles.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)
...所以在mystyles.css中,我有以下(再次,就像在bootstrap.css中,但我有不同的颜色):
.btn-primary {
background-color: #faa732 !important;
*background-color: #f89406 !important;
background-repeat: repeat-x !important;
border-color: #f89406 #f89406 #ad6704 !important;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25) !important;
background-image: linear-gradient(top, #fbb450, #f89406) !important;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary.disabled,
.btn-primary[disabled] {
background-color: #f89406 !important;
*background-color: #df8505 !important;
}
.btn-primary:active,
.btn-primary.active {
background-color: #c67605 \9 !important;
}
Run Code Online (Sandbox Code Playgroud)
我甚至把它们放在了它们中,并且它仍旧呈现奇怪的颜色,然后在我悬停时添加我的颜色(但只有一半).尝试发布图片,但它不会让我....基本上,在IE中,颜色是正确的和橙色,但在其他浏览器中,它是蓝色与橙色轮廓(蓝色是引导程序中的默认主要颜色),当我将鼠标悬停在它上面时,一半按钮突出显示橙色,但另一半仍然是蓝色,当我完全点击它时,它变为橙色.
谢谢!!