Azure表存储-无法建立连接,因为目标计算机主动拒绝它127.0.0.1:10002 [英] Azure Table Storage - No connection could be made because the target machine actively refused it 127.0.0.1:10002

查看:116
本文介绍了Azure表存储-无法建立连接,因为目标计算机主动拒绝它127.0.0.1:10002的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发ASP.Net MVC&在Windows 8上的Visual Studio 2015中使用表存储的WebApi网站,在开发环境中运行正常(当我在web.config中设置 UseDevelopmentStorage = true 时).我正在尝试点击" http://localhost:80 " 并且无法使用其他端口,我有其他程序要发布到我的网站,并且只会发布到该位置.

I'm developing an ASP.Net MVC & WebApi site that uses table storage in Visual Studio 2015 on Windows 8. It was working fine in the development environment (when I set UseDevelopmentStorage=true in my web.config). I'm trying to hit "http://localhost:80" I have to use this and cannot use another port, have another program I am posting to my site with and it will only post to that location.

我最近运行网站并在代码到达以下代码行时收到以下错误: CloudTable表= cloudTableClient.GetTableReference(tableName);

I've recently run the site and get the following error when my code gets to the following line of code: CloudTable table = cloudTableClient.GetTableReference(tableName);

错误:

由于目标机器处于活动状态,因此无法建立连接拒绝了127.0.0.1:10002

No connection could be made because the target machine actively refused it 127.0.0.1:10002

我尝试了以下操作:

1) Uninstall-Package WindowsAzure.Storage -Version 6.1.0 并从NuGet重新安装

1) Uninstall-Package WindowsAzure.Storage -Version 6.1.0 and reinstalled it from NuGet

2)重新启动Windows

2) Restarted Windows

3)浏览了此处 C:\ Program Files \ Microsoft SDKs \ Azure \ .NET SDK \ v2.7 \ bin ran cspack.ext (我无法看到其他任何与存储相关的内容

3) Browsed here C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.7\bin and ran cspack.ext (I could not see anything else that seems to relate to storage)

它仍然没有运行.关于我可以尝试的任何想法吗?

It's still not running. Any ideas as to what I could try?

更新:

出现上述错误后,我打开了Cloud Explorer窗口,并可以看到我用代码在dev中本地创建的表(假设这意味着我的本地存储模拟器正在运行),但是仍然出现错误.然后,我关闭了窗口,然后再次打开.在扩展存储帐户(经典)"时,它旋转了一点,但最终显示了我创建的表.

After getting the error above I opened up the Cloud Explorer window and could see the tables I'd created locally in dev with my code (assume this means my local storage emulator is running) but I still got the error. I then closed the window and opened it again. It spun a bit while expanding the "Storage Accounts (Classic)" but eventually showed the tables I'd created.

奇怪的是,云资源管理器"窗口中的唯一节点是存储帐户(经典)",我敢肯定之前还有其他节点的列表(例如WebApps等).如果有人可以提供帮助,请问您可以逐步发布有关操作的说明(不是模拟器未运行"之类的信息).这是新事物,因此寻找我的Gran会理解的简单说明.

What is strange is that the only node in the "Cloud Explorer" window is "Storage Accounts (Classic)", I'm sure there was a list of other nodes before (i.e. WebApps etc). If anyone can help with this please can you post step by step instructions on what to do (not something like "the emulator is not running"). New to this so looking for simple instructions my gran would understand.

非常感谢.

推荐答案

您必须启动存储模拟器.它位于%programfiles(x86)%\ Microsoft SDKs \ Azure \ Storage Emulator \ AzureStorageEmulator.exe 中.

You have to start the storage emulator. It is located in %programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe.

作为奖励,这是一个批处理脚本,用于清理和启动模拟器.

As a bonus, here's a batch script for cleaning up the emulator, as well as starting it.

SET emu="%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe"
%emu% stop
%emu% clear all
%emu% start

更新

经典存储帐户和新"存储帐户之间的区别可以找到

The difference between classic and "new" storage accounts can be found here.

经典存储帐户是使用现有服务管理创建的API(过去几个版本提供的REST API堆栈年).较新的存储帐户是使用新的Azure创建的资源管理器(ARM)API(也包装在PowerShell和CLI现在).最终,它们为您的应用程序提供了相同的资源,但是它们的创建/管理方式不同,有些细微差别差异(例如标记通过以下方式创建的资源的能力ARM脚本).

Classic storage accounts are created using existing Service Management API's (the REST API stack that's been available for the past several years). The newer storage accounts are created with the new Azure Resource Manager (ARM) API's (which are also wrapped in PowerShell and CLI now). Ultimately they provide the same resources to your apps, but they're created/managed differently, and there are a few nuanced differences (such as the ability to tag resources that are created via ARM scripts).

您无法转换经典存储帐户(或任何经典资源)到较新的类型.无论如何,您实际上并不需要,除非您尝试混合传统资源和新资源,例如添加基于ARM的资源虚拟机连接到基于经典的虚拟网络,或启动坐在经典存储帐户中的vhd映像中的基于ARM的VM(对于该示例,您始终可以将vhd复制到新存储帐户).请注意,用于常规存储(blob/tables/queues),您只需要URI和主要(或次要)键.有了这些,您可以从以下位置访问您的存储资源从任何VM/网站/任何位置,无论您是否要访问例如,来自传统或新虚拟机的存储.

You can't convert a classic storage account (or any classic resource) to a newer type. You don't really need to anyway, unless you're trying to mix resources from classic and new, such as adding ARM-based virtual machines to a classic-based virtual network, or spin up an ARM-based VM from a vhd image sitting in a classic storage account (and for that example, you could always just copy the vhd to a new storage account). Note that, for general storage usage (blobs/tables/queues), you just need the URI and the primary (or secondary) key. With those, you can access your storage resources from anywhere, from any VM/website/etc, regardless if you're accessing storage from classic or new virtual machines, for example.

TL; DR:区别在于正在使用什么API来管理存储帐户.用于将数据下载/上传到容器的现有API和SDK可以同时使用.

TL;DR: The difference is what API's are being used to manage the storage account. Existing API's and SDK's for downloading/uploading data to containers work with both.

这篇关于Azure表存储-无法建立连接,因为目标计算机主动拒绝它127.0.0.1:10002的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆