当前位置: 首页 > news >正文

徐汇网站推广公司工信部的网站备案

徐汇网站推广公司,工信部的网站备案,网站开发的毕设开题报告,网页突然打不开是什么原因原因#xff1a;ABP默认使用的数据库是sqlServer#xff0c;本地没有安装sqlServer#xff0c;安装的是mysql#xff0c;需要更换数据库 ABP版本#xff1a;9.0 此处以官网TodoApp项目为例 打开EntityFrameworkCore程序集#xff0c;可以看到默认使用的是sqlServerABP默认使用的数据库是sqlServer本地没有安装sqlServer安装的是mysql需要更换数据库 ABP版本9.0 此处以官网TodoApp项目为例 打开EntityFrameworkCore程序集可以看到默认使用的是sqlServer此处截图为已安装mysql依赖包 步骤一、安装mysql依赖包 https://abp.io/packages 如果没安装 ABP CLI 先安装 dotnet tool install -g Volo.Abp.Studio.Cli安装ABP依赖包 abp add-package Volo.Abp.EntityFrameworkCore.MySQL安装完mysql依赖包后sqlserve依赖包可以删除也可以留着 步骤二、更改TodoAppEntityFrameworkCoreModule.cs文件 1、将 font stylecolor:rgb(214, 51, 132);UseSqlServer()/font 改为 font stylecolor:rgb(214, 51, 132);UseMySQL()/font 2、引入 Volo.Abp.EntityFrameworkCore.MySQL 命名空间 3、将 font stylecolor:rgb(214, 51, 132);typeof(AbpEntityFrameworkCoreSqlServerModule/font) 替换为 font stylecolor:rgb(214, 51, 132);typeof(AbpEntityFrameworkCoreMySQLModule)/font 修改完成代码如下 using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.BackgroundJobs.EntityFrameworkCore; using Volo.Abp.BlobStoring.Database.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.Modularity; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.Studio; using Volo.Abp.TenantManagement.EntityFrameworkCore;namespace TodoApp.EntityFrameworkCore;[DependsOn(typeof(TodoAppDomainModule),typeof(AbpPermissionManagementEntityFrameworkCoreModule),typeof(AbpSettingManagementEntityFrameworkCoreModule),typeof(AbpEntityFrameworkCoreMySQLModule),typeof(AbpBackgroundJobsEntityFrameworkCoreModule),typeof(AbpAuditLoggingEntityFrameworkCoreModule),typeof(AbpFeatureManagementEntityFrameworkCoreModule),typeof(AbpIdentityEntityFrameworkCoreModule),typeof(AbpOpenIddictEntityFrameworkCoreModule),typeof(AbpTenantManagementEntityFrameworkCoreModule),typeof(BlobStoringDatabaseEntityFrameworkCoreModule))] public class TodoAppEntityFrameworkCoreModule : AbpModule {public override void PreConfigureServices(ServiceConfigurationContext context){TodoAppEfCoreEntityExtensionMappings.Configure();}public override void ConfigureServices(ServiceConfigurationContext context){context.Services.AddAbpDbContextTodoAppDbContext(options {/* Remove includeAllEntities: true to create* default repositories only for aggregate roots */options.AddDefaultRepositories(includeAllEntities: true);});if (AbpStudioAnalyzeHelper.IsInAnalyzeMode){return;}ConfigureAbpDbContextOptions(options {/* The main point to change your DBMS.* See also TodoAppDbContextFactory for EF Core tooling. */options.UseMySQL();});} } 步骤三、修改TodoAppStoreDbContextFactory.cs 将 UseSqlServer 修改为 UseMySQL public TodoAppDbContext CreateDbContext(string[] args) {var configuration BuildConfiguration();TodoAppEfCoreEntityExtensionMappings.Configure();var builder new DbContextOptionsBuilderTodoAppDbContext().UseMySql(configuration.GetConnectionString(Default), ServerVersion.Parse(5.7.38-mysql));return new TodoAppDbContext(builder.Options); }步骤四、更改连接字符串 更改appsettings.json配置文件下的连接字符串TodoApp.Web 和 TodoApp.DbMigrator程序集下 ConnectionStrings: {Default: Server120.79.25.229;databasetodoDatabase;uidroot;pwd1126438236qq.com;},步骤五、数据库迁移 1、删除TodoApp.EntityFrameworkCore程序集下Migrations文件夹中的所有文件并重新构建解决方案 如果没删除迁移的时候会报错 2、在包管理控制台上执行迁移命令注意默认项目要选 TodoApp.EntityFrameworkCore 执行迁移命令 add-migration initial更新数据库命令 update-database数据库迁移过程中遇到的错误 1、配置文件appsettings.json中连接字符串错误
http://www.dnsts.com.cn/news/233010.html

相关文章:

  • 提供信息门户网站搭建怎样做电商 入手
  • 丰县数据网站建设多少钱网络技术题库
  • 广州市门户网站建设品牌企业网站优化服务商
  • 建设一个微网站要花多少钱WordPress清爽主题
  • 做网站云服务器选择多大带宽创新的成都网站建设
  • 文字网站和图片网站哪个难做乐陵seo网站优化
  • 盐城做网站找哪家好佛山市城市建设档案馆网站
  • 商城站时刻表烟台建设银行网站
  • 哪些网站可以做视频收费企业宣传网
  • 网业分离是什么苏州优化件
  • 网站做百度竞价的标志做网站后台主要负责什么
  • 工作室网站建设要多大内存广州安全教育平台视频
  • 阿里云购买网站空间网站公司怎么做
  • 学校网站建设对教学的意义做网站怎么收集资料
  • 一个综合网站上线多少钱竞价是什么意思
  • 无锡网站排名优化费用seo还有用吗
  • 成都的建站公司浏览器在线打开网页
  • 昆明网站制作方案定制为什么要给企业建设网站?
  • 赣州酒店网站建设天津建网站
  • 北京建网站定制价格网站加ico图标
  • dede制作的网站挂马做网站服务
  • 网站建设狼盾网络更改wordpress语言
  • 高校文明建设网站百度词条官网入口
  • 云南网站建设公司优化网站seo策略
  • 泰州做企业网站wordpress 自适应插件
  • 建设一个网站需要多少钱医院建筑工程网
  • 网站开发 问题解决企业网页申请制作步骤
  • 个人网站备案可以做项目网站vi设计找哪家公司
  • 网站活动页面设计青岛物流公司网站建设
  • 新的seo网站优化排名 排名百度商桥绑定网站