Visual Studio 多项目解决方案选项 [英] Visual Studio Multi-Project Solution Options

查看:39
本文介绍了Visual Studio 多项目解决方案选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 VS2003 解决方案,其中包含 21 个 ASP.NET 1.1 项目.我的目标是最终将它们迁移到 2.0,然后是 4.0.主要有不同部门的内部管理应用.

I have a VS2003 solution with 21 ASP.NET 1.1 projects in it. My goal is to eventually migrate them to 2.0 and then 4.0. There are mainly internal admin apps for different departments.

我现在想在 VS2010 中创建一个多项目解决方案,并在 VS2010 中的 ASP.NET 4.0 Web 窗体中一次迁移/重新编码这些解决方案.所有项目都会有一些通用的工件,例如 CSS、脚本和图像.使用资源是否可以帮助处理公共文件?是否可以为所有项目使用一个母版页?

I want to create a multi-project solution now in VS2010 and migrate/re-code these one at a time in ASP.NET 4.0 Web Forms in VS2010. There will be some artifacts common to all projects such as CSS, scripts and images. Could the use of Resources help with the common files and would it be possible to have a single master page for all projects?

在这里创建多项目解决方案的最佳选择是什么?

What are the best options for creating a multi-project solution here?

推荐答案

据我所知,您的目标是跨项目共享 CSS、JS 文件等资源.一种方法是使用 链接文件 在 Visual Studio 中.我们在其中一个解决方案中广泛地执行此操作,在该解决方案中,我们在项目中共享许多类文件和签名密钥.链接文件基本上涉及将文件放在解决方案中的一个项目中,然后从解决方案的其他项目链接到这些文件.

From what I understand, your goal is to share resources like CSS, JS files across projects. One way to do it would be to use linked files in Visual Studio. We do it extensively in one of our solutions where we share many class files and signing keys acorss projects. Linking files basically involves putting the files in one project in the solution and then linking to them from other projects of the solution.

在部署包含链接文件的项目时,您必须小心一点,因为链接文件不会将文件物理复制到目标项目.因此,即使您的项目有一个 css 文件夹,VS 中该文件夹下显示的链接文件实际上并不存在于磁盘的目录结构中.如果链接classes,链接class文件的项目的dll会包含链接的class文件,但是对于css、JS、common masterpage等资源文件,部署时不会复制过来.您可以利用构建脚本或一些简单的批处理文件来处理这些问题.这应该可以解决您的问题.

You have to be a little careful though during deployment of projects containing linked files as linking the file does not physically copy the file to the destination project. So even if your project has a css folder, the linked file shown under that folder in VS is not physically there in the directory structure on the disk . If you link classes, the dll for the project that has the linked class file will include the linked class, but for resource files like css, JS and common masterpage, they will not be copied over when you deploy. You can leverage build scripts or some simple batch files to handle those issues. This should solve your problem.

这篇关于Visual Studio 多项目解决方案选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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