devenv 与 aspnet_compiler

发布于 2024-10-02 02:41:29 字数 301 浏览 0 评论 0原文

如果我使用 aspnet_compiler 发布 ASP.NET MVC 网站,它是否会执行与 devenv 相同的任务?或者只是预编译以最小化启动延迟?

IE 我的要求是能够编译和发布 ASP.NET 网站。 在这种情况下,我应该首先使用 devenv 构建网站,然后使用 aspnet_compiler 预编译并复制文件(发布)吗?

或者,如果我只使用 aspnet_compiler,是否也会构建(编译)相关 dll 的源和参考项目?

非常感谢您的回复。 多谢。

If I use aspnet_compiler to publish an ASP.NET MVC web site, does it do the same tasks that devenv would do? Or is it just pre-compiling to minimize the startup delay?

I.E.
my requirnment is to be able to compile and publish an ASP.NET web site.
in this case, should I use devenv first to build the web site, and then use aspnet_compiler to pre-compile and copy the files over (Publish)?

Or if I just use aspnet_compiler would that also do the building (compiling) of the source and reference projects to relevent dlls?

Your responses are highly appreciated.
Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橙幽之幻 2024-10-09 02:41:29

让我们从简短的回答开始 - aspnet_compiler.exeASP.NET MVC 无关。

MVC 项目由 devenv.exemsbuild.exe 或其他任何其他编译器(Roslyn 有人吗?)编译。但这两个是VS安装时提供的。

aspnet_compiler 用于[在编译意义上]编译 WSP - 网站项目。在 WSP 中,后面的每个代码都被编译成单独的 DLL。但是 MVC 项目会像 WAP - Web 应用程序项目一样编译成单个 DLL。

我怀疑您是否有 WSP 和 MVC,即使您有 - 仍然最好使用 devenv 进行编译,因为 devenv 编译 ashx 文件,而 aspnet_compiler 则不会。这可能会导致运行时失败。

为了更好地理解问题进行研究

网站项目与 Web 应用程序项目

虽然,我相信在 VS15 中 WSP 已经消失了

Lets start from short answer - aspnet_compiler.exe is not related to ASP.NET MVC.

MVC projects are compiled either by devenv.exe or msbuild.exe or whatever else is out there (Roslyn anyone?). But those 2 are provided with VS installation.

aspnet_compiler is used [in compilation sense] to compile WSP - web site projects. In WSP each code behind is compiled into separate DLL. But MVC projects compile into single DLL like WAP - web application project.

I doubt you have WSP and MVC, and even if you had one - still, it is better compile using devenv because devenv compiles ashx files and aspnet_compiler doesn't. This could lead to failures at runtime.

To understand problem better research on

web site projects vs web application project

Although, I believe in VS15 WSP is gone

蒲公英的约定 2024-10-09 02:41:29

我不知道是否有aspnet_compiler之类的东西。看看“Visual C# ->”的一部分ASP.NET Web 应用程序的项目文件:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.\WebApplications\Microsoft.WebApplication.targets" />

第一行是标准 C# 目标。其次,更有趣,因为它是 ASP.NET 特定的。如果您查看其内容,您会发现发布目标的定义,这可能就是您正在寻找的内容。

为了构建和发布您的项目,您可以使用(或者甚至只是发布,如果有预定义的依赖项,我还没有检查它)

msbuild /t:Build,Publish <project file>

I don't know if ther is such thing as aspnet_compiler. Have a look at part of 'Visual C# -> ASP.NET Web Application' project file:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.\WebApplications\Microsoft.WebApplication.targets" />

First line is standard C# target. Second, is more interesting as it is ASP.NET specyfic. If you look into its content you will find definition of of Publish target and that is probably what you are looking for.

For building and publishing your project you can use (or even just Publish if there are predefined dependencies, I haven't check it)

msbuild /t:Build,Publish <project file>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文