英文:
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.
When I try to use Resources.Resources, the first 'Resources' defaults to '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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论