在构建网站项目或其解决方案时,如何生成该项目的预编译 DLL?
这可能是一个重复的问题,因为我发现了一些相似但不完全相同的问题。 标题几乎说明了一切,但详细信息如下:
我在 VS2008 中的基本设置是两个位于同一解决方案中的网站项目(不是 Web 应用程序项目!); 将它们称为 A 和 B。A 依赖于 B,因为 B 包含一个用户控件,我将其构建到自定义服务器控件中。
理想情况下,我想做的是通过一键式方式构建所有内容:为 B 生成预编译的 DLL(无需单独单击“发布”),然后将 A 构建/发布到我的 IIS 虚拟目录。 那么,我该如何实现这一点呢?
只需单击一次即可完成所有操作(“构建解决方案”现在似乎无法做到这一点)的原因有两个:首先,更少的点击意味着忘记步骤或执行无序操作的机会更少,并且通常犯错误的机会更少(KISS,对吧?)。 其次,我不知道如何配置我的用户控制网站项目 (B),以便它在我指定的位置生成 DLL - 或者是否可以这样做。 理想情况下,我可以对其进行设置,以便 DLL 最终位于 “[B 的项目目录]/bin/debug/”
或类似的位置。 如果可能的话,我想避免使用命令行(例如msbuild),因为我对它的理解甚至比VS GUI还要少。
编辑:另一个相关问题是 - 是否可以在 C# 类库项目中构建它,而不是在网站项目 (B) 内构建我的 ASP.NET 用户控件(内置到自定义服务器控件中) ,这应该解决所有这些问题?
This might be a duplicate question as I have found a few that are similar, but not exactly the same. The title pretty much says it all, but here are the details:
The basic setup I have in VS2008 is two web site projects (not web application projects!) living in the same solution; call them A and B. A depends on B, since B contains a user control which I build into a custom server control.
Ideally, what I would like to do is have a one-click way to build everything: generate the precompiled DLL for B (without having to separately click "Publish") and then build/publish A to my IIS virtual directory. So, how do I accomplish this?
The reason for doing everything in a single click (which "Build Solution" doesn't seem to do right now) is twofold: first, fewer clicks means fewer opportunities to forget a step, or do something out-of-order, and generally less chance of making a mistake (K.I.S.S., right?). Second, I can't figure out how to configure my user control web site project (B) so that it generates the DLL in a location that I specify - or if this is even possible to do. Ideally I could just set it up so that the DLL ends up in "[B's project directory]/bin/debug/"
or something like that. I want to avoid using the command line (e.g. msbuild) if possible, since I understand that even less than the VS GUI.
EDIT: Another, related question is - instead of building my ASP.NET user control (which gets built into a custom server control) inside of a Web Site Project (B), is it possible to just build it in a C# class library project, which should solve all of these issues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用Web 部署项目 已集成到 VS 中,并通过其 UI 进行一些自定义,但如果您想真正深入研究并自定义该流程,您将必须了解 MSBuild。
Sayed Ibrahim Hashimi
我的书:Microsoft 构建引擎内部:使用 MSBuild 和 Team Foundation Build
You can use Web Deplooyment Projects which are integrated into VS and have some customizations through its UI but if you want to really dig into and customize the process you will have to know MSBuild.
Sayed Ibrahim Hashimi
My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build