如何讲我在VS中开发的Web网站发布到外面的服务器???????????????????

HashCodeWithJava 2004-10-09 09:37:15
我自己在家里开发了一个Web网站,名字叫WebTest1.然后以自己机器作为服务器,测试http://localhost/WebTest1/WebForm1.aspx成功了.

我又在网上寻找到了一个免费的ASP.NET空间,可以通过FTP上传上去.

但是当我把整个WebTest1目录上传上去后,访问http://xxx.xxx.xxx/WebTest1/WebForm1.aspx的时候就出现错误了...

然后我又测试了一个单页的,代码内置的111.aspx,http://xxx.xxx.xxx/111.aspx就成功了.


1.请问一下大家这是怎么回事?
2.请问一下,如果要发布网站,我应该把什么文件上传上去? 可以不把*.cs源代码不传上去吗?

感激万分!!!!!!!!!!!!!!
...全文
267 14 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
ark_matrix 2004-10-10
  • 打赏
  • 举报
回复
不要把WebTest1目录整个上传,把WebTest1目录下的相关目录和文件上传
最后这样访问
http://xxx.xxx.xxx/WebForm1.aspx
HashCodeWithJava 2004-10-10
  • 打赏
  • 举报
回复
谢谢各位大哥,我已经明白了.
只需要把aspx和bin目录文件上传上去就OK了.而且还不能传其它WebConfig等配置文件才行!
cancersyf 2004-10-10
  • 打赏
  • 举报
回复
发布的时候你可以把所有的.cs文件删除掉,bin目录必须上传
ark_matrix 2004-10-10
  • 打赏
  • 举报
回复
需要
HashCodeWithJava 2004-10-10
  • 打赏
  • 举报
回复
bin目录需要上传不?
HashCodeWithJava 2004-10-09
  • 打赏
  • 举报
回复
回复 ark_matrix(matrix)
?第一个问题提示的错误信息是什么


Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>


HashCodeWithJava 2004-10-09
  • 打赏
  • 举报
回复
老大,我只能用FTP上传,不能在别人的机器上执行程序啊!!!
heiding 2004-10-09
  • 打赏
  • 举报
回复
支持中...
仓木泽 2004-10-09
  • 打赏
  • 举报
回复
虚拟目录问题
免费的asp.net空间
home.cnbol.net
10MB
不错的
ark_matrix 2004-10-09
  • 打赏
  • 举报
回复
?第一个问题提示的错误信息是什么
listhome 2004-10-09
  • 打赏
  • 举报
回复
问一下,在那找的免费Asp.NET空间?
listhome 2004-10-09
  • 打赏
  • 举报
回复
1.打开你的.net,用鼠标右击你的工程(解决方案),选择add new project(添加新建项目)。

2.选择setup and deployment projects(安装和部署项目)的 web setup project(web安装项目)。(注意setupproject的存放路径。通常默认)

3.vs的窗口会显示文件系统(you setup name)。用鼠标点击左栏下的"web application folder" 的加号,右键选中"web application folder",选择"添加项目输出",
同时选中primary output 和content files。

4.你的工程中会新增一个yousetupname的工程,就是安装的项目。保存一下,有时会出错。

5.因为.xml, .rpt, .gif文件不能自动加到项目中,所以要手动加。在解决方案资源管理器中,右击YouSetup project(你的安装项目名),选中"添加文件",然后把你的.rpt, .xml, .gif文件加入;

6.如果你用了crystal report,就要添加crystal reprot的支持文件。在解决方案资源管理器中,右击YouSetup project(你的安装项目名),选中"添加合并模块",在窗口中找到,并选中C:\Program Files\Common Files\Merge Modules\DotNETCrystalReports.msm, 打开,就加入了;



7.右击"目标计算机上的文件系统",选中属性,在属性窗口中,将productName设置为"你要打包的项目名"

8.右击"web应用程序文件夹",选中属性,在属性窗口中,将DefaultDocument设置为"你的默认登录页"即"起始页",

9.选中你的yousetupname工程,按右键,选中"生成";或在主菜单的"生成"中选中"生成yourSetupFileName";

10.然后,在C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\KaoQin\文件的存放路径下会有一个yousetupname的文件夹,下面还有一个debug的文件夹,你要的就是debug下面的所有文件。

11.将debug folder 下的文件考到你要安装的机器上,然后安装就可以了,如果有数据库,你可以将库事先还原过去,就可以用了。



ark_matrix 2004-10-09
  • 打赏
  • 举报
回复
2.
不用把*.cs上传,上传的文件包括.aspx,.ascx等页面文件,还有图片,还有bin整个目录,web.config,global.asax等。
listhome 2004-10-09
  • 打赏
  • 举报
回复
当然可以不传CS了

你在vS里添加一个安装工程,他会帮你做成一个安装文件的,我以前有这个资料,现在找不到了!

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧