Comments (11)
Hi zfima! Thanks for filing this issue. Could you provide more details? Are you using Visual Studio? Did you download a credentials.json file as part of your set up? A lot of our quickstarts have this as a step early
Another important step is to make sure if you are using VS is to make sure the file is in the Explorer:
- Drag credentials.json (downloaded in Step 1) into your Visual Studio Solution Explorer.
- Select credentials.json, and then go to the Properties window and set the Copy to Output Directory field to Copy always.
from dotnet-samples.
Hi
i use VS2017 professional
i did downloaded json file, of course
i did put allthis properties
json can be read with Assets.Open, but not with the FileStream
from dotnet-samples.
Hello, everyone, did you decide how to use FileStream in this case?
from dotnet-samples.
Closing due to inactivity. Let us know if the directions Anu provided no longer work.
from dotnet-samples.
System.IO.FileNotFoundException: Could not find file Exception credentials.json
Same Exception occures when i tried to integrate google sheets in xamarin forms. here is the sample code
` static string[] Scopes = { SheetsService.Scope.SpreadsheetsReadonly };
static string ApplicationName = "Google Sheets API .NET Quickstart";
public MainPage()
{
InitializeComponent();
GetExcelData();
}
private void GetExcelData()
{
UserCredential credential;
string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "My Project-dc555efb493f.json");
// var x = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "My Project-dc555efb493f.json");
using (var stream =
new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
// The file token.json stores the user's access and refresh tokens, and is created
// automatically when the authorization flow completes for the first time.
string credPath = "token.json";
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
Scopes,
"user",
CancellationToken.None,
new FileDataStore(credPath, true)).Result;
Console.WriteLine("Credential file saved to: " + credPath);
}`
from dotnet-samples.
This sample was only designed to work as a Console application, and won't function on Xamarin.
from dotnet-samples.
Thanks @erickoledadevrel
In the Console Application it was working fine.
Can i somehow able to run in the xamarin forms project by shared project or something?
from dotnet-samples.
Hi, gopalwasthi123 did you find a solution for this issue.
from dotnet-samples.
@Emsysindiakt No we can't have option to implement it with xamarin. I have implemented it in console app
from dotnet-samples.
still no solution it?
from dotnet-samples.
solution:
copy everything from credential.json file and do it like that.
GoogleCredential credential;
credential = GoogleCredential.FromJson("text from file");
from dotnet-samples.
Related Issues (20)
- [SyncRepoSettings bot] - Invalid config file
- Google CalendarException HOT 5
- Request payload size exceeds the limit: 10485760 bytes. HOT 4
- Unable to download credentials.json for Sheets API HOT 2
- Can't find a sample to use this in a web app HOT 1
- Two Errors in GoogleWebAuthorizationBroker.AuthorizeAsync on Google Calendar .NET Example HOT 2
- This app isn't verified This app hasn't been verified by Google yet. Only proceed if you know and trust the developer.
- This app isn't verified HOT 1
- request is null HOT 5
- How do I verify if an events exists before insert on GoogleCalendar?
- Improve error messages HOT 1
- Provided code doesn't return my tasks Titles
- Google Authentication not connecting when running off .dll vs Visual Studio
- how to Turn on the Google Calendar API for already existing project
- Trying to send email using gmail api and get error on GoogleWebAuthorizationBroker.AuthorizeAsync in asp.net c# HOT 1
- Google Calendar Problem?
- exception
- : 'At least one client secrets (Installed or Web) should be set'
- Invalid URL error
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-samples.