Ambiguous Reference between 'Resources.Resources' and 'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'

huangapple go评论62阅读模式
英文:

Ambiguous Reference between 'Resources.Resources' and 'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'

问题

我正在将一个应用程序从ASP.NET迁移到ASP.NET Core,所以这是我第一次遇到这个问题。
当我尝试使用Resources.Resources时,第一个'Resources'默认为'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'
有人有办法强制使用'Resources.Resources'或忽略'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'吗?更改Resources类的名称不是一个选项,因为这些名称有许多其他依赖项。

英文:

I am migrating an app from ASP.NET to ASP.NET Core so this is the first time I am seeing this issue.
Ambiguous Reference between 'Resources.Resources' and 'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'

When I try to use Resources.Resources, the first 'Resources' defaults to 'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'
Ambiguous Reference between 'Resources.Resources' and 'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'

Does anyone have any ideas on a way to force 'Resources.Resources' or ignore 'Microsoft.AspNetCore.Mvc.ViewFeatures.Resources'? Changing the Resources class names is not an option as those names have many other dependencies.

答案1

得分: 0

找到了一个解决方案

@using ResourcesCore = Resources.Resources;

并将所有的 @Resources 替换为 @ResourcesCore

英文:

Found a solution

@using ResourcesCore = Resources.Resources;

and Replacing all @Resources with @ResourcesCore

huangapple
  • 本文由 发表于 2023年7月12日 21:46:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76671284.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定