问题描述
我一直在使用同一Sitecore项目,已有两年多了.今年春天已升级到Sitecore 7.0,一切都按预期运行.
I've been using this same Sitecore project, for more than 2 years now. Upgraded to Sitecore 7.0 this spring, and everything just ran like it should.
但是昨天,突然间,我似乎无法再运行我的项目了.我正在将Visual Studio 2013与IIS Express(64位)一起使用.当我尝试通过localhost构建并运行我的网站时,它只是挂起了.我什至试图让它加载1小时以上,但仍然加载,却没有任何反应.
But yesterday, suddenly out of nowhere, i can't seem to run my project anymore. I'm using Visual Studio 2013 with IIS Express (64 bit). And when i try to build and run my site through localhost, it just hangs. I even tried to let it load for 1 hour+, but it still just loads with nothing happening.
我尝试用Fiddler对其进行进一步调试,但没有任何反应.我什至试图删除一堆重要文件,例如web.config.但是它仍然可以永久加载,没有错误.
I tried to debug it further with Fiddler, but nothing happens. I even tried to delete a bunch of important files, like web.config. But it still just loads forever, with no error.
如果我创建一个新的空Web项目,则可以立即通过localhost启动它.因此,我的Sitecore项目一定发生了一些奇怪的事情.
If i create a new empty web project, i can start it through localhost instantly. So there must be something weird happening with my Sitecore project.
有人对调试它有任何建议吗,或者您是否经历过类似的事情?
Does anyone have any suggestions for debugging this or have you ever experienced anything like it?
我几乎尝试了任何事情.
I've nearly tried anything.
推荐答案
我不确定您是从哪个版本升级的,但我将执行以下操作(以解决此问题):
I am not sure what version you upgraded from, but I would do the following (in order) to troubleshoot the issue:
- 根据要从哪个版本升级,您可能已经在.NET Framework v2.0而不是v4.0上运行了应用程序池,这是Sitecore 7所必需的.打开IIS,转到您的应用程序池以获取该站点,并确保将其正确设置为在.NET v4.0而非v2.0上运行.如果将其设置为v2.0,请将其更改为v4.0,然后尝试访问该站点.如果问题仍然存在,或者应用程序池已经在v4.0上运行,请继续执行下一步.
- 如步骤1所示,Sitecore 7在.NET 4.5上运行.如果要从早期版本的Sitecore升级,则可能是使用早期版本的.NET编译了您的站点.右键单击Visual Studio中的项目文件,单击 Properties-> Application ,并确保将每个项目的 Target Framework 设置为.NET Framework 4.5.如果将它们设置为其他框架,请对其进行更改,然后再次构建您的解决方案,然后尝试访问您的站点.如果已经将它们设置为目标.NET 4.5,或者问题仍然存在,请继续执行下一步.
- 再次检查您网站根目录上的权限.确保 NETWORK SERVICE 和/或您的IIS用户具有该目录的所有必需的读写权限.如果没有,请应用权限,然后重试该站点.如果问题仍然存在,请继续执行下一步.
- 删除所有Sitecore DLL和项目生成的DLL.将全新的DLL从Sitecore 7的干净下载中复制回到bin/reference目录中,然后再次构建解决方案.尝试再次访问该站点.如果问题仍然存在,则问题可能出在临时Internet文件或配置中.如果是这种情况,请继续执行下一步.
- 从 C:\ Windows \ Microsoft.NET 目录中的 Framework 和 Framework64 文件夹中删除临时ASP.NET文件.请注意,您必须进入应用程序池所针对的.NET版本的目录,并删除临时ASP.NET文件目录的内容.执行此操作时,可能有必要停止您的应用程序池.尝试再次访问您的网站,如果问题仍然存在,请继续执行下一步.
- 尝试从全新下载的Sitecore 7中使用默认值替换您的 web.config ,但请务必事先备份您的备份,以免丢失自定义设置,因为您想要之后将它们添加回去.再次尝试您的网站.这次,如果代码中的某些内容取决于 web.config ,则可能会出现错误.如果发生这种情况是一件好事,因为这意味着您的网站现在正在运行,而您只需添加自定义内容即可解决错误.如果问题仍然存在,请继续执行步骤7.
- 如果您的站点仍处于挂起状态,请尝试一次将 App_Config 目录中的所有配置替换为其干净副本(不包括 ConnectionStrings.config 和 DataFolder.config (如果正在使用它们).此外,禁用/备份并删除所有自定义配置或已安装的不是Sitecore核心的模块的配置.尝试再次访问您的网站.如有必要,请通过合并一次更改/重新启用您的配置来解决所有配置错误,直到找到导致问题的原因或解决所有错误为止.
- Depending on what version you are upgrading from, you may have been running your app pool on .NET Framework v2.0 instead of v4.0, which is required for Sitecore 7. Open up IIS, go to your app pool for the site and make sure that it is correctly set to run on .NET v4.0 and not v2.0. If it was set to v2.0, change it to v4.0 and try access the site. If the issue persists or if the app pool was already running on v4.0 continue to the next step.
- As implied in step 1, Sitecore 7 runs on .NET 4.5. If you are upgrading from an earlier version of Sitecore, it is possible that your site is compiled using an earlier version of .NET. Right click on your project files in Visual Studio, click on Properties->Application and make sure that the Target Framework for each of the projects is set to .NET Framework 4.5. If they were set to a different framework, change them, build your solution again, and then try to access your site. If they were already set to target .NET 4.5 or if the issue persists continue to the next step.
- Double check the permissions on your site root. Make sure that NETWORK SERVICE and/or your IIS User has all of the necessary read and write permissions for the directory. If they do not, apply the permissions and try the site again. If the problem persists, continue to the next step.
- Delete all of the Sitecore DLLs and the DLLs generated by your projects. Copy fresh DLLs from a clean download of Sitecore 7 back into your bin/reference directory and build your solution again. Try to access the site again. If the issue persists, then the problem is likely in temporary internet files or in a config. Continue to the next step if this is the case.
- Delete your Temporary ASP.NET Files from the Framework and Framework64 folders found in the C:\Windows\Microsoft.NET directory. Note that you must go into the directory for the version of .NET that your app pool is running against and delete the contents of the Temporary ASP.NET Files directories. It may be necessary to stop your app pool when you do this. Try to access your site again and if the issue persists, move onto the next step.
- Try replacing your web.config with the default from a clean download of Sitecore 7, but be sure to back yours up before-hand so that you do not lose customizations, as you will want to add them back in after. Try your site again. This time, you may get an error if something in your code is dependent on the web.config. It is a good thing if this happens, as it means that your site is now working and you have only to add back in your customizations to resolve the errors. If your issue persists, continue to step 7.
- If your site is still hanging, try replacing all of your configs in the App_Config directory, one at a time, with their clean copies (excluding ConnectionStrings.config and DataFolder.config, if you are using them). Additionally, disable/backup and remove all custom configs or configs for modules that you have installed that are not Core to Sitecore. Try to access your site again. If necessary, resolve any config errors by merging your changes/re-enabling your configs one at a time until you find one causing the issue or until all errors are resolved.
如果问题仍然存在,请在此信息中发布升级到的Sitecore版本,升级的版本以及安装的所有模块.
If your issue continues, post your the Sitecore version you upgraded to, the version you upgraded from, and any modules you have installed as a comment on this post.
这篇关于Sitecore项目-Localhost挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!