ResX 文件和额外的应用程序层 [英] ResX files and extra application layer

查看:23
本文介绍了ResX 文件和额外的应用程序层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用一些大型 asp.net web 工具包制作 web 应用程序.一开始我们创建了很多基类,例如命令和服务器控件,以使我们的工作更轻松.

we are making an web application using some big asp.net web toolkit. At the beginning we created a lot of base classes such as commands and server controls to make our work easier.

现在,当我们使用它构建我们的应用程序时,我们决定构建另一个应用程序.为了不复制我们所有的工作,而不是从头开始,我们决定将我们的服务器控件、命令和所有基类从 asp.net 项目中分离出来,并将其封装在另一个可重用的项目中...

Now when we built our application using this we decided to biuld another one. To not copy all our work, and not making it from scratch we decided to separate our server controls, commands and all base clases from asp.net project and encapsulate it in another, reusable project...

现在我们遇到了一个大问题,因为其中许多类都使用作为 App_GlobalResources 附加到 aur asp.net 应用程序的 RESX 文件......我们应该把它们放在哪里,或者我们如何使用它们在两者中都可用项目并且仍然有一个不错的应用程序架构?

Now we have the big problem, because many of those classes are using RESX files that are attached to aur asp.net application as App_GlobalResources... Where should we put them, or how can we use them to be avaible in both projects and still have a nice application architecture?

推荐答案

您的服务器控件/命令/基类正在使用的任何资源都需要与这些组件位于同一程序集中.如果您想分发和重用这些组件,它们本质上必须是自包含的,这意味着它们的资源必须与它们一起使用.

Any resources that your server controls/commands/base classes are using need to be in the same assembly as those components. These components have to be essentially self-contained if you want to distribute and reuse them, which means that their resources have to go along with them.

您的 App_GlobalResources resx 文件需要拆分,并将资源放入可重用"程序集中的新资源文件中.

Your App_GlobalResources resx files need to be split up and the resources put into new resource files in the "reusable" assembly.

这篇关于ResX 文件和额外的应用程序层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆