ASP.NET V5无DNXNET、ASP、DNX

2023-09-04 10:52:44 作者:冷言冷语冷情绪。

据我所知,DNX提供调用的ASP.NET应用程序V5的各种新的包管理功能的能力。

I understand that DNX provides the ability to invoke the various new package management features of ASP.NET v5 apps.

不过,是否有可能建造这些应用程序中的一个(使用DNX等)和precompile他们以这样的方式,他们可以部署到(使用八达通),并运行未经修改的IIS服务器上使用.NET Framework 4.5?

However, is it possible to "build" one of these apps (using DNX etc) and "precompile" them in such a way that they can be deployed to (using Octopus) and run on a unmodified IIS server using .NET framework 4.5?

创建项目时,我不得不针对.NET 4.5的选项,而我们构建服务器上安装DNX是不太可能是一个问题,它太很快推出我们的生产网络服务器。

I had the option to target .NET 4.5 when creating the project, and while installing DNX on our build server is unlikely to be a problem, it's too soon to push it out to our production web servers.

推荐答案

没有。你说你可以面向.NET 4.5中的ASP.NET但这是不完全准确的,你可以针对dnx451是净完整的框架4.5.1 + DNX。

No. You said you can target .Net 4.5 in ASP.NET but that isn't exactly accurate you can target dnx451 which is .Net Full Framework 4.5.1 + DNX.

DNX是不是安装。这是不是真的更像是一个XCOPY安装。 DNVM只需下载DNX的特定副本,并在c把它放到一个文件夹:\ Users \用户.dnx \运行时间。如果你不想使用DNX你可以只复制该文件夹。当应用程序引用了运行时的特定版本,它只是调用dnx.exe正确的文件夹按照惯例内 c:\Users\<User>\.dnx\runtimes\<dnx-runtimetype-os-architecture.version>\bin\dnx.exe

DNX is not "installed" in the same fashion as .Net Framework. It isn't really an installation more like an xcopy. DNVM simply downloads a specific copy of the DNX and puts it into a folder under c:\Users\.dnx\runtimes. If you didn't want to use dnx you could just copy the folder. When an application references a specific version of the runtime it just calls dnx.exe within the correct folder by convention c:\Users\<User>\.dnx\runtimes\<dnx-runtimetype-os-architecture.version>\bin\dnx.exe

如果你想甚至避免单独的步骤中 - 在 DNU运行选项来发布将包括副本在通过从本地开发机取副本的应用程序文件夹结构/为approot /运行时间。尼尔的答案提供了更多的细节。它避免了单独安装DNX的要求,但DNX仍在使用。使用 - 无源是没有必要的,独立的,以捆绑的运行与应用程序决定的。

If you want to even avoid a separate step the --runtime option in dnu publish will include a copy within the application folder structure /approot/runtimes by taking a copy from the local dev machine. Neil's answer provides more details. It avoids the requirement of installing the dnx separately but the dnx is still used. Using --no-source is not necessary and independent of decision to bundled the runtime with the application.

如果你想知道如何IIS发现的DNX开始执行,当你发布一个项目列入/wwwroot/bin/AspNetLoader.dll项目。这提供了一个切入点IIS。还有一个小的web.config也包括它提供了位置的DNX可执行文件。

In case you are wondering how does IIS "find" the dnx to begin execution, when you publish the project a project is included in /wwwroot/bin/AspNetLoader.dll. This provides an entry point for IIS. Also a small web.config is also included which provides the location to the dnx executable.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="bootstrapper-version" value="1.0.0-beta4" />
    <add key="runtime-path" value="..\approot\runtimes" />
    <add key="dnx-version" value="1.0.0-beta6-12120" />
    <add key="dnx-clr" value="coreclr" />
    <add key="dnx-app-base" value="..\approot\src\AspDotNetFiveDemo.Web" />
  </appSettings>
</configuration>

这'引导'是真的只提供向后兼容IIS。它没有在其他环境中使用。例如,如果自主机使用HTTP.SYS DNX.exe只是直接调用,并提供了组件和参数。

This 'bootstrap' is really only to provide backwards compatibility with IIS. It isn't used in other environment. For example if self hosting using http.sys DNX.exe is just called directly and provided the assemblies and parameters.

 
精彩推荐