devenv 与 aspnet_compiler
如果我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
让我们从简短的回答开始 -
aspnet_compiler.exe
与ASP.NET MVC
无关。MVC 项目由
devenv.exe
或msbuild.exe
或其他任何其他编译器(Roslyn 有人吗?)编译。但这两个是VS安装时提供的。aspnet_compiler
用于[在编译意义上]编译 WSP - 网站项目。在 WSP 中,后面的每个代码都被编译成单独的 DLL。但是 MVC 项目会像 WAP - Web 应用程序项目一样编译成单个 DLL。我怀疑您是否有 WSP 和 MVC,即使您有 - 仍然最好使用 devenv 进行编译,因为 devenv 编译 ashx 文件,而 aspnet_compiler 则不会。这可能会导致运行时失败。
为了更好地理解问题进行研究
虽然,我相信在 VS15 中 WSP 已经消失了
Lets start from short answer -
aspnet_compiler.exe
is not related toASP.NET MVC
.MVC projects are compiled either by
devenv.exe
ormsbuild.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 compilesashx
files and aspnet_compiler doesn't. This could lead to failures at runtime.To understand problem better research on
Although, I believe in VS15 WSP is gone
我不知道是否有aspnet_compiler之类的东西。看看“Visual C# ->”的一部分ASP.NET Web 应用程序的项目文件:
第一行是标准 C# 目标。其次,更有趣,因为它是 ASP.NET 特定的。如果您查看其内容,您会发现发布目标的定义,这可能就是您正在寻找的内容。
为了构建和发布您的项目,您可以使用(或者甚至只是发布,如果有预定义的依赖项,我还没有检查它)
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:
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)