【问题标题】:Upgrade solution from .net framework 4 to higher ver. 4.7.2; 4.8.VS2013将解决方案从 .net framework 4 升级到更高版本。 4.7.2; 4.8.VS2013
【发布时间】:2020-06-22 17:40:19
【问题描述】:

从 .net 4 更新到更高版本后,例如4.5, 4.72 我得到以下错误。我更新了参考资料等。

使用 TargetFrameworkMigrator 手动执行更新。

Error   9209    'Note.Svc.Models.ps_AddNoteBrs_Result' does not contain a definition for 'Modified' and no extension method 'Modified' accepting a first argument of type 'Note.Svc.Models.ps_AddNoteBrs_Result' could be found (are you missing a using directive or an assembly reference?)   C:\Work\Note\Note.Svc\TakeAddSvc.svc.cs 1492    31  Note.Svc
Error   9224    'Note.Svc.Models.ps_AddNoteBrs_Result' does not contain a definition for 'Modified' and no extension method 'Modified' accepting a first argument of type 'Note.Svc.Models.ps_AddNoteBrs_Result' could be found (are you missing a using directive or an assembly reference?)   C:\Work\Note\Note.Svc\TakeAddSvc.svc.cs 1500    31  Note.Svc
Error   9249    'Note.Svc.Models.ps_AddNoteBrs_Result' does not contain a definition for 'Modified' and no extension method 'Modified' accepting a first argument of type 'Note.Svc.Models.ps_AddNoteBrs_Result' could be found (are you missing a using directive or an assembly reference?)   C:\Work\Note\Note.Svc\TakeAddSvc.svc.cs 1513    35  Note.Svc
Error   4777    'Note.Svc.Models.NoteRun' does not contain a definition for 'Checked' and no extension method 'Checked' accepting a first argument of type 'Note.Svc.Models.NoteRun' could be found (are you missing a using directive or an assembly reference?)   C:\Work\Note\Note.Svc\QualityControlTrackingService.svc.cs  511 58  Note.Svc
Error   5712    Cannot implicitly convert type 'System.Collections.Generic.List<Note.Svc.Models.ps_RerportNote_Result> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll]' to 'System.Collections.Generic.List<Note.Svc.Models.ps_RerportNote_Result> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll]' C:\Work\Note\Note.Svc\AddRepSvc.svc.cs  647 42  Note.Svc
Error   5700    Cannot implicitly convert type 'System.Collections.Generic.List<Note.Svc.Models.ps_ReportAddNote_Result> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll]' to 'System.Collections.Generic.List<Note.Svc.Models.ps_ReportAddNote_Result> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll]' C:\Work\Note\Note.Svc\AddRepSvc.svc.cs  646 37  Note.Svc
Error   5838    Cannot implicitly convert type 'System.Collections.Generic.List<Note.Svc.Models.ps_ReportAddNote_Result> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll]' to 'System.Collections.Generic.List<Note.Svc.Models.ps_ReportAddNote_Result> [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll]' C:\Work\Note\Note.Svc\AddRepSvc.svc.cs  664 37  Note.Svc

【问题讨论】:

  • 什么是Note.Svc.Models.ps_AddNoteBrs_ResultNote.Svc.Models.NoteRunNote.Svc.Models.ps_ReportAddNote_ResultNote.Svc.Models.ps_RerportNote_Result
  • 报告和更新程序。
  • 用这么旧的 VS 版本定位 4.8 非常乐观。您正在跳过完整的 C# 编译器重写(又名 Roslyn)、3 个主要的 VS 更新和 3 个主要的框架更新。当社区版免费时,它没有多大意义。

标签: c# .net visual-studio visual-studio-2013 upgrade


【解决方案1】:

包含命名空间 Note.Svc.Models 的项目还必须将目标框架更新为使用它们的项目的兼容版本。

【讨论】:

  • 是的,重建解决方案后会发生什么?
猜你喜欢
  • 1970-01-01
  • 2018-01-09
  • 2023-03-24
  • 2019-07-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-27
  • 2021-12-25
相关资源
最近更新 更多