gpt4 book ai didi

c# - C#中的别名资源文件命名空间

转载 作者:行者123 更新时间:2023-12-04 16:56:31 26 4
gpt4 key购买 nike

我有一个 ASP.net MVC 3 项目,在文件夹中设置了资源文件,例如:

/Resources/EntityName/Views/
/Resources/EntityName/Models/

这意味着访问强类型资源值的命名空间是:
Resources.EntityName.Models.ModelA.Property1
如果我尝试包含命名空间“resources.xxx”,Visual Studio 会给出编译时错误,并且它也不允许 using 别名语法。

无论如何要像普通命名空间一样包含或至少别名资源文件的强类型命名空间?

最佳答案

没有理由不能在类中使用这些对象之一:

using YourProject.Resources.EntityName.Models;

关于c# - C#中的别名资源文件命名空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10981873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com