gpt4 book ai didi

.net - 将 .Net Web 应用程序部署到非 Windows 服务器

转载 作者:可可西里 更新时间:2023-11-01 10:01:41 26 4
gpt4 key购买 nike

我的问题是将 .Net Web 应用程序部署到特定服务器需要什么以及有哪些限制。

服务器是否需要运行 windows?

服务器是否需要安装.Net框架? (这对于非 Windows 服务器可能吗?)

服务器是否需要安装IIS? (这对于非 Windows 服务器可能吗?)

我的问题的原因是我们想创建和打包一个可以部署到客户服务器的应用程序,但是我们希望能够为使用 Windows、Linux、Unix 等服务器的客户提供服务。

我需要知道限制和可用的解决方法

最佳答案

Does the server need to be running windows?

没有

Does the server need to have the .Net framework installed on it? (is this possible with non-windows servers?)

没必要,你可以用Mono

Does the server need to have IIS installed on it? (is this possible with non-windows servers?)

不,也适用于 Apache

所以基本上,如果你想在非 Windows 服务器上运行 .NET 应用程序,你将不得不使用 Mono,但正如@Oded 在评论部分指出的那样,有一些移植注意事项 - 你需要确保您没有使用特定于 Windows 的技术(例如 WMI 和 GDI+)并且您的代码是可移植的(没有硬编码路径分隔符,使用 Environment.NewLine 而不是硬编码行终止符),没有 P/Invoke 和 COM 互操作,同样的限制当然适用于您可能使用的任何第三方程序集,等等......

关于.net - 将 .Net Web 应用程序部署到非 Windows 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3647863/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com