Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NETWeb应用程序在本地工作,但在我发布到Azure应用程序服务后,我在所有web请求上都获得了404_Asp.net_Azure - Fatal编程技术网

ASP.NETWeb应用程序在本地工作,但在我发布到Azure应用程序服务后,我在所有web请求上都获得了404

ASP.NETWeb应用程序在本地工作,但在我发布到Azure应用程序服务后,我在所有web请求上都获得了404,asp.net,azure,Asp.net,Azure,我创建了一个非常简单的ASP.NET web应用程序,当我在Visual Studio外部本地运行它时,它就会工作。当我通过VisualStudio发布时,HTML和JS的功能与预期一致,但当我尝试发出请求时,它只会返回一个404,子HTTP状态为0。我在Azure门户的日志中发现了失败的请求,但它没有给我任何帮助(也许我不知道我应该寻找什么) JS请求: var mainURL = "api/values"; function getData() { $.ajax(mainURL +

我创建了一个非常简单的ASP.NET web应用程序,当我在Visual Studio外部本地运行它时,它就会工作。当我通过VisualStudio发布时,HTML和JS的功能与预期一致,但当我尝试发出请求时,它只会返回一个404,子HTTP状态为0。我在Azure门户的日志中发现了失败的请求,但它没有给我任何帮助(也许我不知道我应该寻找什么)

JS请求:

var mainURL = "api/values";
function getData() {
    $.ajax(mainURL + "",
        {
            method: "GET",
            success: getFeedback,
            error: error
        });
}
在ValuesController.cs中获取端点:

[HttpGet]
public IEnumerable<string> Get()
{
     return new String[] { "String 1", "String 2"};
}

您可以向我们展示整个ValuesController、Startup.cs和Program.cs吗?@CiubotariuFlorin如果我们的应用程序在Azure Portal中启用了Application Insight,我们对Startup.cs和Program.cs的期望值是多少?您可以向我们展示整个ValuesController,Startup.cs和Program.cs?@ciubotariufrorin如果我们的应用程序在Azure Portal中启用了Application Insight,我们对Startup.cs和Program.cs的期望是什么?
timestamp [UTC]:  2019-06-14T18:37:28.4905616Z
id:-  |t6BRs.GIk+K.5d5a779d_
name:-  GET Values/Get
url:-  https://snowcrew.azurewebsites.net/api/values
success:-  False
resultCode:-  404
duration:-  26,036.3695
performanceBucket:-  15sec-30sec
itemType:-  request
customDimensions:-  {"_MS.ProcessedByMetricExtractors":"(Name:'Requests',Ver:'1.1')","AspNetCoreEnvironment":"Production"}
operation_Name:-  GET Values/Get
operation_Id:-  t6BRs
operation_ParentId:-  |t6BRs.GIk+K
session_Id:-  Weaja
user_Id:-  /2aXn
application_Version:-  1.0.0.0
client_Type:-  PC
client_IP:-  0.0.0.0
client_City:-  MyCity
client_StateOrProvince:-  MyState
client_CountryOrRegion:-  United States
cloud_RoleName:-  snowcrew
cloud_RoleInstance:-  RD0004FFDD7879
appId:-  9114c348-64a5-4490-8c37-7c469252ba2a
appName:-  SnowCrew
iKey:-  55a1c3de-a678-49af-9fcb-9212758047fb
sdkVersion:-  ar_aspnet5c:2.6.1
itemId:-  97b165e2-8ed3-11e9-905b-5feb1a1b3fb1
itemCount:-  1