简体   繁体   English

Web部署IIS7

[英]Web Deployment IIS7

I have not deployed websites before on an IIS7. 我尚未在IIS7上部署网站。 I was wondering if anyone could help me out to make sure that I am doing it right. 我想知道是否有人可以帮助我确保我做对了。 I have an ASP/C# website that I am trying to deploy. 我有一个要部署的ASP / C#网站。 The only access that I have to the server is through RDP. 我对服务器的唯一访问是通过RDP。 No FTP or whatsoever. 没有FTP或其他任何方式。

I've read guides about different deployment options and none really talks about File System deployment which I think is my only option. 我已经阅读了有关不同部署选项的指南,但没有人真正谈论文件系统部署,我认为这是我唯一的选择。

Basically I deploy the files locally to my laptop and I copy and paste it to the remote server. 基本上,我将文件本地部署到笔记本电脑,然后将其复制并粘贴到远程服务器。 I placed the compiled site to the \\intepub\\wwwroot and use the inetmgr to add that to the default site. 我将编译后的站点放置到\\ intepub \\ wwwroot并使用inetmgr将其添加到默认站点。 I did set the correct app pool to .net 4.0 since that's the framework that I used for the asp site. 我确实将正确的应用程序池设置为.net 4.0,因为这是我用于ASP网站的框架。

I can access some of the components/pages of the site but unable to for some of them. 我可以访问网站的某些组件/页面,但无法访问其中的某些组件/页面。 It's giving me errors but the one thing that I noticed is that the errors contains directory paths that refers to my laptop where I developed the site. 它给了我错误,但我注意到的一件事是这些错误包含目录路径,该目录路径引用了我开发该网站的便携式计算机。 So, I'm assuming that I am not publishing the website correctly. 因此,我假设我没有正确发布该网站。

Sounds like your returned table on the statement 听起来像语句中返回的表

if (GetData.getTable().Rows.Count != 0)

is null . null This would throw the exception that you are getting. 这将引发您所得到的异常。 You can fix this by making sure your table object is an actual instance (assuming Datatable): 您可以通过确保表对象是实际实例(假设Datatable)来解决此问题:

Datatable tbl = new Datatable();  //OK

Datatable tbl = null;   //Not OK

Also, you said the NullReferenceException was just one of them. 另外,您说过NullReferenceException只是其中之一。 Maybe that's not the root problem. 也许这不是根本问题。 You should have the part of the code that opens the connection and executes the query within a try/catch block, and if there is a problem there you can catch the error and know what is going wrong. 您应该拥有一部分代码来打开连接并在try / catch块中执行查询,如果有问题,您可以捕获错误并知道出了什么问题。 If you can narrow down your problem, we can be more helpful. 如果您可以缩小问题范围,我们将为您提供更多帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM