Is it possible to create custom GraphServiceClient in UiPath? (and how) - vb.net

We are needing additional Office 365 functionality that is not provided by the standard Office 365 package by UiPath (such as marking emails as read/not read, changing the subject lines of emails already in a shared mailbox, etc).
Having looked through Microsoft documentation, it should be possible via code - but this doesn't seem to work in UiPath.
https://learn.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS
UiPath moans that it needs netstandard version 2.0.0.0 to create a new GraphServiceClient - however, I don't think that I'm able to add that assembly to the project.
Does anyone know how we can create the custom graph connection in UiPath?

As I don't want to copy the doc page, all you need is written on Github (Microsoft Graph .NET Client Library).
The Microsoft Graph .NET Client Library targets .NetStandard 2.0 and
.Net Framework 4.6.2.
To install the client library via NuGet:
Search for Microsoft.Graph in the NuGet Library, or
Type Install-Package Microsoft.Graph into the Package Manager Console.
For UiPath setup, use your link. Should work in the Invoke code block.

Related

Access wcf from netcoreapp2.0

I have a asp dotnet core 2.0 project that needs to talk to a downstream WCF service
The proj file is targeting netcoreapp2.0
I have added nuget packages for System.ServiceModel.Primitives and have almost everything I need apart from something in the System.ServiceModel.Configuration namespace which doesnt appear to be available on Nuget
In the past, I have successfully talked to the WCF service in a netcore1.1 project (by making it target net461)
However, this doesnt appear to be an option if you want to take advantage of netCore2.0 functionality. If you target net461 then you cant access netcore2.0 features
Should this be possible?
Am I doing something wrong?
Can you target net461 and also use netcore2.0 features?
or is there a way I can target netcoreapp2.0 and still access System.ServiceModel.Configuration?
Or do I need to target netcoreapp2.0 and do something else that allows me to access System.ServiceModel.Configuration?
thanks
If you use at least VS 2017 version 15.5, you can add the WCF service as a connected service. The wizard will add the required packages and generate the client code. (in previous VS 2017 versions, you'd need a preview extension).
You can access this wizard from the "Add Connected Service" context menu item:

Google YouTube API vb.net references

I am new to the Google oAuth and YouTube APIs. I am trying to follow the examples at https://developers.google.com/youtube/v3/code_samples/dotnet - specifically the Upload Video example. I am working with VB.NET - visual studio 2013. I have added the libraries via nuget. When I add the import statements, I am getting Namespace or Type cannot be found for Google.Apis.Auth.OAuth2, Google.Apis.YouTube.v3 and Google.Apis.YouTube.v3.Data. Google.Apis.Services, Upload and Util.Store work fine. I suspect I am missing a reference somewhere, but I cannot find what to look for or add. My project is in .Net 4.5.1. I have references to Google.Apis, Google.Apis.Core and Google.Apis.PlatformServices. From what I can tell, I need a reference to Google.Apis.Auth.OAuth2, but I cannot find that.
I finally found the libraries on nuget to reference. Look for Google APIs Auth Client Library and Google.Apis.YouTube.vs Client Library in nuget.

How we Integrated Libgit2 library in Visual Studion 2010 Windows Application

I downloaded two DLLs (libgit2sharp.dll and git2.dll) from this site.
After that I successfully added Libgit2sharp.dll by add reference in my .NET Windows application. Now when I add git2.dll by add reference in my .NET Windows Application, it gives an error:
a reference to 'C:\User\nitesh\git2.dll' could not be added please make sure that the file is accessible and that it is a valid assembly or COM component
Can anyone please help me understand the problem?
I downloaded two DLLs (libgit2sharp.dll and git2.dll) from this site.
First off, this is not a distribution channel that the libgit2/libgit2sharp team has anything to do with.
Install as a NuGet package:
Official releases are available as a NuGet package if you prefer to download pre-built sources. See this post which explains how to install the NuGet Package Manager in Visual Studio.
This is the easiest way to make LibGit2Sharp available to your project.
Build from the source code:
You can download the source code and build the C# code into LibGit2Sharp.dll from https://github.com/libgit2/libgit2sharp, which includes the pre-built version of git2.dll which works for the particular version of the C# code.
Easiest way to build the assembly is by launching the build.libgit2sharp.cmd. This will create a Build folder into which you'll find the LibGit2Sharp.dll and a NativeBinaries folder with the native binaries.
Now when I add git2.dll by add reference in my .NET Windows Application, it gives an error
As for the error message, it sounds like you're trying to add the git2.dll to the project as though it were a CLR/.NET assembly. It is however built from C and isn't something VS is going to do anything useful with. You do not need to add it to your project.
It does need to be available for libgit2sharp to load. The following graph depicts the folder hierarchy that libgit2sharp expects
NativeBinaries+
|___amd64+
|___git2-{shortsha}.dll
|___git2-{shortsha}.pdb
|_____x86+
|___git2-{shortsha}.dll
|___git2-{shortsha}.pdb
Note: This folder structure will be dynamically created in your project output folder if you installed LibGit2Sharp as a NuGet package. However, if you built the project from the source code, you'll have to copy this folder structure as part of your project build process yourself.

Unable to resolve assemblies that use Portable Class Libraries

I'm having a problem with assembly resolution on an end-user machine and I believe it's related to using Portable Class Libraries....
I have a .NET 4.0 application that was originally written in Visual Studio 2010. Recently we upgraded to Visual Studio 2012 and we've created a few projects that are Portable Class Libraries. I don't believe we need these features now, but we're also building a Windows 8 Store application that might benefit from these libraries.
When I compile my project, what exactly does the portable library feature do? I expect that it allows me to run it on different frameworks without modification or recompiling.
When I look at the library in reflector dotPeek it shows the Platform attribute as:
.NETPortable,Version=v4.0,Profile=Profile5
And the references seem 2.0-ish:
mscorlib, Version=2.0.5.0
System, Version=2.0.5.0
System.Runtime.Serialization, Version=2.0.5.0
When I run the application on this end-user's machine, I see an error in the log file:
Could not load file or assembly, 'System.Core, Version=2.0.5.0...'
Googling System.Core 2.0.5.0 seems to refer to SilverLight -- which appears to be one of the targeted frameworks.
This machine does not have Visual Studio installed, but has .NET 4.0 (4.0.3 update)
Is there something I should be doing differently to compile, something I should investigate in my dependencies or something I should be looking to install on the end-user machine? What does the 2.0.5.0 refer to?
For .NET 4, you need an update (KB2468871) for Portable Class Libraries to work. From the KB Article:
Feature 5
Changes to the support portable libraries. These changes include API
updates and binder modifications. This update enables the CLR to bind
successfully to portable libraries so that a single DLL can run on the
.NET Framework 4, on Silverlight, on Xbox, or on the Windows Phone.
This update adds public Silverlight APIs to the .NET Framework 4 in
the same location. The API signatures will remain consistent across
the platform. All modifications are 100 percent compatible and will
not break any existing code.
Also see the "Deploying A .NET Framework App" section of the MSDN Portable Class Library Documentation.
EDIT: Actually, if the machine has .NET 4.0.3 installed as you mention, that should be sufficient. Can you double-check to make sure that it is actually installed?

VB.NET / VSTO2008 fails; can't find runtime

I'm trying to deploy a VB.NET app which is an extension to Excel using VSTO. It works fine in the development environment, but when someone else (without a dev environment installed, just the .NET framework) installs it, they get:
The common language runtime could not be loaded by <application>. Contact your administrator for further assistance.
Google pops up the microsoft help page for this:
http://msdn.microsoft.com/en-us/library/6s0wczt9.aspx
But I've verified that the .NET versions are the same on both machines. For VSTO apps in 2k5 there was a specific vsto runtime library users needed to install -- is there something similar for VS2008 that I haven't found yet? Any ideas besides that?
Thanks in advance!
For VSTO apps built with Visual Studio 2008, The VSTO version 3.0 Runtime is required.
Here is the download page: http://www.microsoft.com/downloads/details.aspx?FamilyID=54eb3a5a-0e52-40f9-a2d1-eecd7a092dcb&DisplayLang=en
Make sure they have the correct version of the .NET framework. If they have .NET 1.1 (or even 2.0) installed, and you're targetting the 3.5 framework, you can get this error message.
We had the same problem. It's all to do with security policy.
There are issues with the security policy for your DLL's when running VSTO projects.
Namely you need to grant 'full trust' to your assemblies. What this means you have to A) sign your projects with a key, and B) register your assemblies as having full trust during deployment (which can be done easily with CASPOL.exe: http://msdn.microsoft.com/en-us/library/cb6t8dtz.aspx)
Its very easy to do. Alternatively you can roll your own security-setting assembly which you integrate into your msi (thats what we did)
Check out this MSDN Article for the full details:
http://msdn.microsoft.com/en-us/library/zdc263t0.aspx
Install VSTO runtime 3.0
Then update it to VSTO 3.0 SP1
also install VSTO_PTExtLibs.exe (PIA extension libs for runtime) if you are referencing these in your project.