日期:2014-05-20  浏览次数:21030 次

使用机器名可以正常访问,但使用IP地址就不行了!
奇怪了,使用机器名可以正常访问,但使用IP地址就不行了!
在Web项目中,用到了InfoPath,用了Microsoft   SharePoint,ASP.NET的State   Menagement中,Session   state   mode使用是SQLServer
使用机器名可以正常访问,但是使用IP地址就出现以下错误信息

Server   Error   in   '/ '   Application.
--------------------------------------------

Object   reference   not   set   to   an   instance   of   an   object.  
Description:   An   unhandled   exception   occurred   during   the   execution   of   the   current   web   request.   Please   review   the   stack   trace   for   more   information   about   the   error   and   where   it   originated   in   the   code.  

Exception   Details:   System.NullReferenceException:   Object   reference   not   set   to   an   instance   of   an   object.

Source   Error:  

An   unhandled   exception   was   generated   during   the   execution   of   the   current   web   request.   Information   regarding   the   origin   and   location   of   the   exception   can   be   identified   using   the   exception   stack   trace   below.    

Stack   Trace:  


[NullReferenceException:   Object   reference   not   set   to   an   instance   of   an   object.]
      Microsoft.Office.Server.Administration.SqlSessionStateResolver.System.Web.IPartitionResolver.ResolvePartition(Object   key)   +77
      System.Web.PartitionManager.GetPartition(IPartitionResolver   partitionResolver,   String   id)   +244
      System.Web.SessionState.SqlSessionStateStore.GetConnection(String   id,   Boolean&   usePooling)   +52
      System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext   context,   String   id,   SessionStateStoreData   item,   Object   lockId,   Boolean   newItem)   +178
      System.Web.SessionState.SessionStateModule.OnReleaseState(Object   source,   EventArgs   eventArgs)   +355
      System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   +92
      System.Web.HttpApplication.ExecuteStep(IExecutionStep   step,   Boolean&   completedSynchronously)   +64

 


--------------------------------------------
Version   Information:   Microsoft   .NET   Framework   Version:2.0.50727.42;   ASP.NET   Version:2.0.50727.42  

请高手给予指点啊!谢谢了!

------解决方案--------------------
如果可以使用机器名或者localhost可以访问,例如:http://localhost/...
想改为IP访问。
1.打开IIS,找到文件目录,右键-> 所有任务-> 权限向导-> 下一步....都点Yes;
2.防火墙-> 高级--> 本地连接--> 设置--> web服务器(http),打勾,即可!
------解决方案--------------------
SharePoint网站可以在外网访问,通过备用访问映射就可以做到。
如果能PING通IP却PING不通机器名,那就是DNS域名解析的问题,
可以通过修改etc\hosts文件解决。
------解决方案--------------------
楼主,按下面的做法试试
1.打开IIS,找到文件目录,右键-> 所有任务-> 权限向导-> 下一步....都点Yes;