我正在尝试使用 Visual Studio 在本地运行 Azure Function 并执行定时触发器,并且我已在 local.settings.json 中进行了设置
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
Run Code Online (Sandbox Code Playgroud)
但当我运行它时,出现错误“无效的存储帐户‘devstoreaccount1’。
我尝试启动模拟器(管理员,关闭防火墙),但出现此错误。默认安装,无需修改。
C:\Windows\system32>cd C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator
C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init
Windows Azure Storage Emulator 5.2.0.0 command line tool
Found SQL Instance (localdb)\MSSQLLocalDB.
Creating database AzureStorageEmulatorDb52 on SQL instance '(localdb)\MSSQLLocalDB'.
Granting database access to user Robin-PC\Robin.
Database access for user Robin-PC\Robin was granted.
Initialization successful. The storage emulator is now ready for use.
The storage emulator was successfully initialized and is ready to use.
C:\Program Files …Run Code Online (Sandbox Code Playgroud) 在VS2015的下面的代码中,我进入acefbd了第一行,这是正确的.但在第二次测试中,我分成单独的行,输出是abcdef.
这是预期的行为吗?
#include <future>
#include <iostream>
using namespace std;
void a () {
std::cout << "a";
std::this_thread::sleep_for (std::chrono::seconds (3));
std::cout << "b";
}
void c () {
std::cout << "c";
std::this_thread::sleep_for (std::chrono::seconds (4));
std::cout << "d";
}
void e () {
std::cout << "e";
std::this_thread::sleep_for (std::chrono::seconds (2));
std::cout << "f";
}
int main ()
{
std::async (std::launch::async, a), std::async (std::launch::async, c), std::async (std::launch::async, e);
cout << "\n2nd Test" << endl;
std::async (std::launch::async, a);
std::async (std::launch::async, c); …Run Code Online (Sandbox Code Playgroud)