Razor页面无法使用构建操作“内容”读取文件。特性
我有一个资源文件名“ index.en-us.resx”,最初是“嵌入式资源”构建动作,并且在本地化方面效果很好。
但是,当它是“嵌入资源”时,它将其编译到.dll
文件中。 就我而言,用户可以不时修改.Resx
文件的内容。 发布后不能是.dll
文件。
无论如何,是否可以将.resx
文件读为“内容”(因为它不会被编译到.dll
)中?
I have a resources file name "Index.en-US.resx", initially it was "embedded resources" build action and it worked well in localization.
But when it is "embedded resources", it compiled it into .dll
file.
In my case, users are able to modify the content of .resx
file from time to time.
It cannot be .dll
file after published.
Is there anyway to read the .resx
file as "content" (since it will not be compiled into .dll
) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不希望您的
.resx
文件在发布后将其编译到dll
中,我认为您可以将其放入wwwroot
,因为wwwroot
是存储静态文件的地方,该项目不会将其编译为dll
,如下所示。您可以看到该资源文件发布后不会在DLL中编译。/I.SSTATIC.NET/AD5VO.PNG“ ALT =”在此处输入图像描述”>
If you don't want your
.resx
file to be compiled intodll
after published, I think you can put it in yourwwwroot
, Becausewwwroot
is where static files are stored, the project will not compile it as adll
, As follow. You can see the resource file is not be compiled in dll after published.