简体   繁体   中英

ECS1705 which has a higher version than referenced assembly

My project called 'Gui Tester' has a microsoft.windowsdesktop.App.WindowsForms framework version 6.0.0. In addition, it has a project reference to WinForms class called 'WinFormsLibrary3' which its framework version 6.0.9. This causes the error below. How do I make both versions the same in order to solve this issue? I was unable to find a way to remove/add/update a framework.

A link to a sample solution (\AssemblyError\GuiTester\GuiTester.sln) can be found here - https://1drv.ms/u/s?AuZvh6FckScbhMpi02_Dm-YCBE00ew?e=KKNyLi

Error CS1705 Assembly 'WinFormsLibrary3' with identity 'WinFormsLibrary3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Windows.Forms, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' which has a higher version than referenced assembly 'System.Windows.Forms' with identity 'System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

There is no way your Gui tester project (version 6.0.0) can open your winFormsLibrary3 (version 6.0.9). Since the lower version does not recognize or support a higher version which it never designs for. What you can do is create a new solution of gui tester with a higher version and just copy all the files from the old gui tester into your new gui tester.

As I wrote in the comment, you can try downgrade your target framework, but some times it cause unexpected behaviour更改 .Net 目标框架 https://ourtechroom.com/fix/how-to-downgrade.net-framework-version-in-visual-studio/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM