把不同的项目放在1个解决方案 [英] putting different project under 1 solution

查看:101
本文介绍了把不同的项目放在1个解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对1个解决方案,多个Web项目问题感到困惑。我正在使用Visual Studio 2013,asp.net(c#)。在1解决方案下,我有一个类库和2个Web项目。



它运行良好但现在当我在实时服务器上部署它时,用户将如何打开这些不同的项目。



例如解决方案1> Project1和Project2



这两个都是网络项目,然后我将如何调用每个项目下的每个.aspx页面?具有相同的地址,如www.user.com/

I am confused about '1 Solution, Multiple Web Projects' problem. I am using Visual studio 2013 , asp.net (c#). Under 1 solution i have a class library and 2 Web projects.

It works well but now when i deploy it on live server then how a user will open these different projects.

e.g. Solution 1 > Project1 and Project2

both are web projects then how i will call each .aspx page under each project ? having same address like www.user.com/

推荐答案

首先,将项目设置为启动项目,并在其中调用解决方案中的其他项目。然后部署解决方案将所有项目作为用户的要求进行调用。确保您已将该项目作为启动项目,其中包含所有需要的启动页面。
First off all set a project as start-up project and inside that call other projects present at the solution . And then deploy the solution all projects gets called as the requirement of the user . Make sure you have made that project as start-up one which contains your start-up pages required for allpication .


根据您的要求,您可以使用几个选项。但这实际上取决于这两个项目是否彼此独立或者是否共享父母子女关系。



1.您可以将项目2中的参考添加到项目1然后使用post build事件将内容复制到Project 1中的文件夹。



示例:

xcopy / s / y / d
You have a couple of options that might work depending on your requirements. But it really depends on if the two projects are independent from one another or if they share a parent child relationship.

1. You can add a reference from Project 2 into Project 1 and then use post build events to copy the content to folders inside Project 1.

Example:
xcopy /s /y /d "


(ProjectDir)评论\ * .ascx
(ProjectDir)Comments\*.ascx" "


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

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