Linux 上传我的 ASP.NET 网站?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4907865/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 02:44:40  来源:igfitidea点击:

Uploading my ASP.NET website?

asp.netlinuxvisual-studio-2010visual-studio

提问by joao

So, bit of silly question here but browsing google didn't really get me any good information.

所以,这里有点愚蠢的问题,但浏览谷歌并没有真正让我得到任何好的信息。

I've just finished my first website using ASP.net, I've been building it with visual studio but now I need to upload it my web server.

我刚刚使用 ASP.net 完成了我的第一个网站,我一直在用 Visual Studio 构建它,但现在我需要将它上传到我的 Web 服务器。

So there I went, popped Filezilla and tried to upload my whole folder. No dice.

所以我去了,弹出 Filezilla 并尝试上传我的整个文件夹。没有骰子。

My question is, what needs to be uploaded? And is there any step I need to take in Visual Studio before uploading?

我的问题是,需要上传什么?在上传之前,我需要在 Visual Studio 中采取任何步骤吗?

回答by Mike Cole

You should use the Publish feature in Visual Studio. There should be a nice little wizard to follow and FTP is one of the options.

您应该使用 Visual Studio 中的发布功能。应该有一个不错的小向导可以遵循,FTP 是其中一个选项。

回答by Carlos Mu?oz

UPDATE:

更新:

In order for asp.net to run in linux you need to make sure to install mod_mono


为了让 asp.net 在 linux 中运行,您需要确保安装mod_mono


ORIGINAL ANSWER

原答案

Scott Gu will show you how to

Scott Gu 将向您展示如何

Since a picture is worth a thousand words here you have two!

因为一张图片值一千字,所以你有两个!

To publish *Web applications

发布*Web 应用程序

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

EDIT

编辑

To publish Web sites

发布网站

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by dhirschl

If you are using ASP.NET with Linux, you will need to use Mono.

如果您在 Linux 上使用 ASP.NET,则需要使用 Mono。

More information about configuring your server can be found at the Mono ASP.NET FAQ

可以在Mono ASP.NET 常见问题解答中找到有关配置服务器的更多信息

It appears that you do not have the mod_mono Apache module installed (or installed correctly) - so your files are being interpreted as text files.

您似乎没有安装(或正确安装) mod_mono Apache 模块 - 因此您的文件被解释为文本文件。

回答by indra

You need an IIS server to host ASP.Net sites and applications. I think the reason you're getting html-type pages back when you request ASPX pages is because the server isnt' IIS or ASP.Net compatible. The pages aren't being handled by the relevant IIS module so your server is serving the unprocessed ASPX pages back to you without 'filling-in' the dynamic server-generated bits.

您需要一个 IIS 服务器来托管 ASP.Net 站点和应用程序。我认为您在请求 ASPX 页面时返回 html 类型页面的原因是因为服务器与 IIS 或 ASP.Net 不兼容。这些页面没有由相关的 IIS 模块处理,因此您的服务器将未处理的 ASPX 页面返回给您,而无需“填充”动态服务器生成的位。

All responders have given great advice about the use of Publish ...wizard in Visual studio.

所有响应者都Publish ...对 Visual Studio 中使用向导给出了很好的建议。

FYI if you're pre-compiling your site you just need the web.config, .aspxand .ASCXmarkup pages (not the .cs or .designer.cs files) and the application DLLs (from the /obj/Release directory).

仅供参考,如果您正在预编译您的网站,您只需要web.config,.aspx.ASCX标记页面(不是 .cs 或 .designer.cs 文件)和应用程序 DLL(来自 /obj/Release 目录)。

Good luck.

祝你好运。

回答by Ron Rivero

you should download the Microsoft Visual Studio Web Deployment Project. then after downloading install it at yoour pc. restart your Visual Studio. open the project and right click on the Project and click "Add web deployment Project". give project a path and build. You can find the deployable project at the path given of Web deployment project.

您应该下载 Microsoft Visual Studio Web 部署项目。然后下载后安装在你的电脑上。重新启动您的 Visual Studio。打开项目并右键单击该项目,然后单击“添加 Web 部署项目”。给项目一个路径和构建。您可以在Web 部署项目给出的路径中找到可部署项目。