简体   繁体   English

如何正确更改程序集中的版本(启用EF CodeFirst迁移)?

[英]How to change version in assembly (with enabled EF CodeFirst migrations) correctly?

There is an assembly (1.0.0.0) with enabled migrations. 有一个启用了迁移的程序集(1.0.0.0)。 After publishing (build server) version are incremented (to 1.0.0.1) and EF throws MetadataException : "Schema specified is not valid. Errors: \\r\\n(0,0) : error 0004: Could not load file or assembly 'MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=blablabla' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"} 发布(构建服务器)后,版本增加(至1.0.0.1),并且EF引发MetadataException :“指定的架构无效。错误:\\ r \\ n(0,0):错误0004:无法加载文件或程序集'MyAssemblyName ,版本= 1.0.0.0,文化=中性,PublicKeyToken = blablabla”或其依赖项之一。所定位的程序集的清单定义与程序集引用不匹配。(HRESULT的异常:0x80131040)“}

How to change version in assembly (with enabled EF CodeFirst migrations) correctly? 如何正确更改程序集中的版本(启用EF CodeFirst迁移)?

In solution explorer, right click on your project (Not solution) --> click on properties --> in application tab --> click on assembly infornation. 在解决方案资源管理器中,右键单击您的项目(不是解决方案)->单击属性->在应用程序选项卡中->单击程序集信息。

There you can change the assembly version. 在那里您可以更改程序集版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 EF 6 CodeFirst迁移不起作用 - EF 6 CodeFirst Migrations Not Working EF CodeFirst迁移不起作用 - EF CodeFirst migrations not working EF Codefirst迁移新数据库 - EF Codefirst Migrations new database .Net Core2.2:如何在EF Codefirst方法中更改字符集 - .Net Core2.2 : how to change characterset in EF codefirst approach 如何将EF CodeFirst多重性从一变为零/一? - How to change EF CodeFirst multiplicity from one to zero/one? Ef Core:如何将多个不同 dbContexts 的迁移放到一个程序集中? - Ef Core: How to put migrations for sveral different dbContexts to one assembly? 使用Unity配置依赖项注入时,如何防止EF CodeFirst尝试在数据库上运行迁移? - How do I prevent EF CodeFirst from trying to run migrations on my database, when configuring dependency injection with Unity? 如何在连接字符串中为EF CodeFirst配置ProviderManifestToken - How to configure ProviderManifestToken for EF CodeFirst in a Connection String 如何为Entity Framework CodeFirst迁移设置隔离级别 - How to set the isolation level for Entity Framework CodeFirst Migrations 如何以编程方式回滚EF 7迁移? - How to rollback EF 7 migrations programmatically?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM