TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shyams Shah
NA
1
2.7k
Google Task api does not work in Window service ?
May 14 2014 6:58 AM
Hi
i am creating task in Google Email using C# in Window service. My code sample is
UserCredential credential;
using (var stream = new FileStream(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "client_secrets.json"), FileMode.Open, FileAccess.Read))
{
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
new[] { TasksService.Scope.Tasks },
"
[email protected]
", CancellationToken.None, new FileDataStore("Tasks.Auth.Store")).Result;
}
// Create the service.
var service = new TasksService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Tasks API Sample",
});
Task task = new Task { Title = "Shyam Task" };
task.Notes = "Please complete me";
task.Due = DateTime.Now.AddHours(2);
Task result = service.Tasks.Insert(task, "@default").Execute();
The above code is written in OnStart method of Window service. The above code sample is run in window form application and Console Application.
I have tried by calling consoleapplication exe from window service but it was not success. Code neither give error not give any message. it only stuck.
Reply
Answers (
1
)
How to create a telnet port
Window Service not executing the console application exe