我正在尝试使用来自Microsoft的一个名为WordCount的流行示例来了解服务结构 的开发过程。 我还没有Azure帐户,所以我在我的Windows 10上安装了本地群集 。我浏览了微软 网站上的说明,其中大部分都适用。我可以看到在群集管理器:Microsoft示例WordCount在本地群集上不起作用
http://localhost:19080/Explorer
在那里我可以看到应用程序:
fabric:/WordCount WordCount 1.0.0 OK Ready
从Powershell的里面我可以连接到本地集群 与输出运行的cmdlet预期
Get-ServiceFabricApplication
Get-ServiceFabricService -ApplicationName 'fabric:/WordCount'
Get-ServiceFabricPartition 'fabric:/WordCount/WordCountService'
问题是,当我运行
http://localhost:8081/wordcount/index.html
浏览器不显示任何内容。它应该显示 由客户端JavaScript 生成并由ASP.NET Web API处理的单词的计数。我的浏览器启用了JavaScript。
我对样本中的代码还不够了解,但我有用VS2017加载的4个项目的解决方案。我只是想尽快让它工作。
下面我在浏览器(FireFox)中附加了控制台输出的一部分。显然,JS脚本得到了
[HTTP/1.1 404 Not Found 0ms]
响应所有请求。
POST
XHR
http://localhost:8081//wordcount/index.html/api/AddWord/WYVyl [HTTP/1.1 404 Not Found 0ms]
XML Parsing Error: no root element found
Location: http://localhost:8081//wordcount/index.html/api/AddWord/WYVyl
Line Number 1, Column 1: WYVyl:1:1
POST
XHR
http://localhost:8081//wordcount/index.html/api/AddWord/YcIMv [HTTP/1.1 404 Not Found 0ms]
XML Parsing Error: no root element found
Location: http://localhost:8081//wordcount/index.html/api/AddWord/YcIMv
Line Number 1, Column 1: YcIMv:1:1
GET
XHR
http://localhost:8081//wordcount/index.html/api/Count [HTTP/1.1 404 Not Found 0ms]
XML Parsing Error: no root element found
Location: http://localhost:8081//wordcount/index.html /api/Count?c=0.7465426272903215
Line Number 1, Column 1: Count:1:1
你确定你有正确的地址(http:// localhost:8081/wordcount/index.html )?你是否收到任何服务器端或客户端错误。你说“浏览器不显示任何东西” - >所以它保持空白,没有javascript错误报告等。 –
我编辑发布添加一些更多的信息。浏览器正在向所有请求获取[HTTP/1.1 404 Not Found 0ms] –
您能否包含示例代码的链接? –