Closed seunghun-kim closed 5 years ago
I'd expect System.Interactive.Async to be installed via NuGet dependencies.
Please could you give details of exactly how you're creating the console application? What kind of project file are you using? (If you could include the project file itself, that would be great.)
Note that to reproduce this, we shouldn't need your TestData type at all - just creating a document with an anonymous type should be fine. For example, here's a console app which works fine for me (targeting netcoreapp2.1), but which sounds like it would still fail for you:
using Google.Cloud.Firestore;
using System;
using System.Threading.Tasks;
namespace Issue3081
{
class Program
{
static async Task Main(string[] args)
{
FirestoreDb db = FirestoreDb.Create(args[0]);
CollectionReference collection = db.Collection("TestData");
DocumentReference document = await collection.AddAsync(new { Name = "Test doc", Score = 20 });
DocumentSnapshot snapshot = await document.GetSnapshotAsync();
Console.WriteLine(snapshot.GetValue<string>("Name"));
Console.WriteLine(snapshot.GetValue<long>("Score"));
}
}
}
Here's my csproj file for that:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Cloud.Firestore" Version="1.0.0-beta20" />
</ItemGroup>
</Project>
I've just tried the same thing with .NET 4.7.2 using an "old style" project file, and that worked fine too.
Could you give details about what's in the output directory that you're executing from?
I uninstalled System.Interactive.Async and reinstalled Google.Cloud.Firestore. That solved my issue. Thanks.
Environment details
Issue details
I'm trying to use firestore db as my board test result storage. In order to test it's well functioning, I've modified sample code a bit. Here's my code.
In case if you need it, there's TestData class below:
It works fine just before
DocumentSnapshot snapshot = await document.GetSnapshotAsync();
. ButGetSnapshotAsync()
throws exception:And here's details.
I can't find out what's the problem. Please give me some help.
Steps to reproduce
namespace RealtimeDatabase_Test { class Program { static void Main(string[] args) { RunFireStoreService(); }
}