简体   繁体   English

按F5键并在浏览器中启动无济于事

[英]pressing F5 and launching in browser does nothing

I'm new to ASP.Net. 我是ASP.Net的新手。 I have opened a solution which builds with no errors. 我已经打开了一个没有错误构建的解决方案。 When I press F5 , a new tab is opened in my Chrome window with the URL http://localhost:4435/foo/Default.aspx . 当我按F5键时,将在Chrome窗口中打开一个新标签,其中包含URL http://localhost:4435/foo/Default.aspx However, nothing happens -- no page is displayed. 但是,什么也没发生-没有页面显示。 It just appears to be loading forever. 它似乎永远都在加载。

When I try to access the page without going through Studio, using a URL that looks like this: http://localhost/solution-name/trunk/foo/ , I get the following error: 当我尝试不通过Studio访问页面时,使用如下所示的URL: http://localhost/solution-name/trunk/foo/ ,出现以下错误:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error: 


Line 253:      </controls>
Line 254:    </pages>
Line 255:    <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="AspNetSqlRoleProvider">
Line 256:      <providers>
Line 257:        <clear/>

I'm not sure if the 2 are related. 我不确定这2个是否相关。 I just want to get this solution up and running. 我只想启动并运行此解决方案。 What am I doing wrong? 我究竟做错了什么?

There are 2 different issues here. 这里有2个不同的问题。

The first (pressing F5 to start) is quite probably due to something in the global.asax (if it exists) or the default.aspx page itself spinning off into nowhere land. 第一个(按F5键开始)很可能是由于global.asax某些内容(如果存在)或default.aspx页本身旋转到任何地方的原因。 Usually a bad configuration of a database connection whose timeout is way too long (like 5 minutes). 通常,数据库连接的配置错误,超时时间太长(例如5分钟)。

The second issue boils down to that location not being the root directory for the application and is a configuration issue. 第二个问题归结为该位置,而不是应用程序的根目录,这是一个配置问题。

What I'd do is first look at the database connection strings, generally located in your web.config, and see if they are valid. 我要做的是先查看通常位于web.config中的数据库连接字符串,然后查看它们是否有效。

You showed 2 different URLS... one with a port number (localhost : 4435) and another without it. 您显示了2个不同的URL ...一个带端口号(localhost:4435),另一个不带端口号。

The first one (with port number) is normally been handle by IIS Express or the integrated Visual Studio web server (that depends on your project configuration) and the second url (without port) is been handled by your local IIS. 第一个(带端口号)通常由IIS Express或集成的Visual Studio Web服务器(取决于您的项目配置)处理,而第二个URL(无端口)由本地IIS处理。

So... You definitely have 2 different issues. 所以...您肯定有2个不同的问题。

About your first issue: 关于您的第一期:

If your project is using IIS Express, I would recommend your to check the configuration and log files (look at the folder %userprofile%\\documents\\IISExpress) 如果您的项目使用的是IIS Express,建议您检查配置和日志文件(查看文件夹%userprofile%\\ documents \\ IISExpress)

Second issue: 第二期:

Open IIS Manager and make sure "solution-name" is marked as Application. 打开IIS管理器,并确保将“解决方案名称”标记为“应用程序”。

Hope it helps. 希望能帮助到你。

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

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