c# - How do I set common values (abstract) for a C# solution in Visual Studio with multiple sub projects?
问题描述
I have a solution with multiple projects each of which connects to the same DB and uses overlapping constant values that I would like to set somewhere instead of replicating manually. I have tried a variety of things online like making a custom class and linking projects to it, setting constants in a project config file (which doesn't exist like the guides claim), and so on. I've been unable to figure this out after more than an hour of searching and experimenting so if you have any ideas, let me know. The structure looks like this (the blue-underlined stuff are some of the projects in the list):
解决方案
您可以在解决方案下创建另一个项目来包含您的课程。
然后所有其他项目都可以引用该项目,这意味着所有其他项目都可以使用相同的功能,而无需复制任何内容。
推荐阅读
- r - 在 R 中使用 tcltk2 包我有什么样的错误?
- json - 使用 FutureBuilder 显示 API 数据
- c++ - 在 C++ 中显示 Qt GUI 时在后台接受套接字连接
- sql - 如何根据 SQL 中的特定列使用“计数”
- marklogic - Marklogic 安全角色
- botframework - 如何将文件上传按钮添加到微软团队机器人框架?
- java - Android MediaController seekbar 在 VideoView 中无法正常工作
- python - 从数据框中提取季度的最后一天
- c++ - C++ - 将具有共同属性的不同、唯一类型的两个排序向量合并到一个新的排序向量中
- python - 尝试在无法访问 Internet 的系统上安装 python 库(pywin32)