#Bots – Error when you update the #NuGet package for System.IdentityModel.Tokens.Jwt on your #MicrosoftBot Application

Hello!

For a few days, I was lucky and go back to the great world of Microsoft Bot. In this one, my main task was to update one Bot I’ve created some time ago.

The update process is fairly simple. Gisela has written a post where he explains the biggest changes, and otherwise you can always browse ans learn from the Bot Framework source code on GitHub.

Now well, there is a stick ugly in the road that added to the 40 ° of fever I have figthed all the Sunday. When I begin to update the NuGet packages in my project, I find the following list (or similar depending on how you’ve used)

clipboard02

The easy path is to perform an “Update All” or follow an order similar to the following list.

  • Newtonsoft.Json
  • Microsoft.WindowsAzure.ConfigurationManager
  • Autofac
  • Microsoft.IdentityModel.Protocol.Extensions
  • Microsoft.Bot.Builder
  • System.IdentityModel.Tokens.Jwt

However, once updated all packages, our Bot will not work anymore and we’ll have a very descriptive error  “An error has ocurred.

clipboard03

The good thing about having the source code of the Bot Framework is after a while, is possible to understand there is a problem with System.IdentityModel.Tokens.Jwt version [5.0.0] . So, we need to make a “rollback” of the same to the version previous to bring our Bot back to life.

clipboard04

This solves the problem, and will have that see if I can put to see the code full so Bot Fwk works with the latest versions. For now, since it is a bit out of my reach; I’ve left a comment on the Issue reported on GitHub (link). As it is closed, if there is no response in a couple of days, I’ll see if I open a new Issue or I start to study about the topic 😀

Greetings @ Toronto

El Bruno

References

Advertisements

#Windows10 – Device Portal Wrapper available via NuGet and source code in #GitHub

Hello!

Some time ago I wrote about the Device Portal capabilities for Hololens. In my case, there are some key actions like remote monitoring, remote apps deploy and to device restart, which are very useful in my developer day to day.

Now is time to say thanks to the Windows Developer team. This is because, the “Windows Device Portal Wrapper” project is already is mature enough to be published on GitHub and as a Nuget package.

Let me deep into this project. The project provides a layer on top of the services REST on that is supports the Device Portal. This project is created in C# and you can use it from WPF or UWP apps.

The sample app included in the project, shows us how to connect to a remote device, and once connected perform some actions. For example, restart it or get device network information.

Clipboard01.png

Browsing a little bit more, I find some devices exposes services which are device specific, like Hololens or XBoxOne. For example, in the Device Portal API of Hololens (link), I find operations to start, stop or download a holographic recording.

clipboard02

The truth is that the time of launch is perfect, since there are 2-3 tasks that I believe that I can automate thanks to these APIs, and that saved me some time in the future.

Greetings @ Toronto

El Bruno

References

#Windows10 – Device Portal Wrapper en #NuGet y #GitHub

Hola !

Hace algún tiempo escribí sobre las capacidades de Device Portal, en especial para Hololens. En mi caso, acciones como el monitoring remoto, la capacidad de desplegar apps y poder reinicar un device, son muy útiles en el día a día como developer.

Hoy me entero gracias al blog de Windows Developer, que el proyecto “Windows Device Portal Wrapper” ya está lo suficientemente maduro como para que esté publicado en GitHub y como un paquete Nuget.

Lo interesante de este proyecto, es que provee una capa de los servicios REST sobre los que se apoya el Device Portal. Este proyecto está creado en C# y se puede utilizar desde apps WPF o UWP.

La app de ejemplo que se incluye en el proyecto, nos muestra como conectar a un device remoto, y una vez conectados como interactuar con el mismo. Por ejemplo para reiniciarlo o para obtener la información de red del device.

Clipboard01.png

Navegando un poco más, me encuentro con que devices como Hololens o XBoxOne poseen servicios especiales para cada uno. Por ejemplo, en las Device Portal API de Hololens (link), encontramos operaciones para comenzar, detener o descargar una grabación holográfica.

clipboard02

La verdad es que el momento de lanzamiento es perfecto, ya que hay 2 o 3 tareas que creo que puedo automatizar gracias a estas APIs y que me ahorrarán algo de tiempo en el futuro.

Saludos @ Toronto

El Bruno

References

#AZURE – Nuevo componente PCL para trabajar con #AzureIoTHub en #NuGet

Hola!

Hoy es día de Build, así que solo un post rápido y útil.El equipo de Azure IoT Hub ha liberado un paquete NuGet con una implementación PCL que soporta Android y iOS (Xamarin), Windows 10 (UWP) y Windows Phone (WinRT) de Azure IoT Hub Client.

image

Asi que, ahora es aún más fácil integrar nuestras apps con el entorno IoT de Azure.

Saludos @ Toronto

-El Bruno

References

#AZURE – New PCL for #AzureIoTHub on #NuGet

Hi!

Quick one for today. The Azure IoT Hub team has just released a NuGet package with a PCL implementation which supports Android and iOS (Xamarin), Windows 10 (UWP) and Windows Phone (WinRT) for the Azure IoT Hub Client.

image

So, now is even more easy to add some IoT features into our apps.

Greetings @ Toronto

-El Bruno

References

#VS2015 – Enviar tweets desde una app #UWP #Windows10 con #TweetMoaSharp

Clipboard02

Hola !

Hace un tiempo escribí un post donde comenté sobre un paquete para trabajar con Twitter desde una Windows 10 Universal App. En ese post comenté también que era una pena que la excelente TweetSharp de Daniel Crenna, no soporte Windows Universal Apps.

Ayer actualizando una app con problemas, me encuentro con TweetMoaSharp. Que es un fork de la última versión de TweetSharp y agrega funcionalidades para poder utilizar estas librerías en apps WinRT. La misma ha sido creada por Troy Willmot (gracias!)

Sobre esta base, la utilización es similar a TweetSharp y la verdad es que después de hacer un par pruebas, funciona muy bien en una app para Windows 10.

image

El paquete aparece si realizas una búsqueda por TweetSharp, a partir de allí es tan simple como agregarlo y comenzar a programar.

image

El siguiente código muestra un ejemplo simple sobre una búsqueda con el criterio “elbruno”

image

Y que devuelve algo similar a esto:

image

Saludos @ Madrid

-El Bruno

References

#VS2015 – Observer Pattern the easy way with #NuGet and #CSharp 6 features

Hola!

These days I’m dealing with a Winforms app who needs tons of love (Thanks Tori!). I’m slowly addidng some stuff like IoC, and I get to a point where I need to upgrade the current implementation of Observer for a better one. Lucky for us, in Net Framework 4.0 the MS team added the cool IObserver<T> interface, however there is some code to be written. And let’s be honest, someones already did it 😉

After a quick search, I found a very cool NuGet package [SimpleBroker]. And the better way to explain the use is with a sample.

In this sample, I have a main view which displays the messages sent from others views. In ugly design mode, probably will be similar to this one.

The Message class is the one, used for communication and it only have 2 properties

In the Send Message view, the Click() event, will create and Publish() an instance of Message.

The main view, has other stuff to do

1. In the Load() event, let’s start a subscription for objects of Message type

2. The subscription will be handled in OnNext(). Which will show line by line the received messages

3. We will close the subscription in the event Closed()

4. in the button Click() we will create and display a new instance of the Send Message view

And using, Bodies Members and String Interpolation the code is very clean, only 25 lines.

Note: Thanks to C# 6 

A live action demo

2015 08 12 Observer

And the Source code in >> https://github.com/elbruno/Blog/tree/master/WindowsFormsApplicationObserver

Saludos @ Madrid

/El Bruno

References

– El Bruno, C#6 Expression Bodied Members https://elbruno.com/2015/07/30/vs2015-c6-using-expression-bodied-members-hell-on-earth/

– El Bruno, C#6 String Interpolation https://elbruno.com/2015/04/20/vs2015-string-interpolation-vs-string-format-your-team-will-love-you/

– MSDN IObserver<T> https://msdn.microsoft.com/en-us/library/dd989239(v=vs.110).aspx

– GitHub SimpleBroker https://github.com/iac249/SimpleBroker

#RESHARPER Search type on #NuGet and add package

Hola!

I really like ReSharper, you can easily get to the idea and understand that is a tool for developers created by developers. I still get amazed with some of the Features. In example, next one I think I’ve seen some description on new release, and today I happily use it.

The next steps are included in the video

1. We find a invalid type in our project

2. We go to ReSharper options and look into “Find this type on nuget.org

3. Select this option and we can see, in the result list, some of the NuGet packages which uses this type

4. Add the package and that’s it !!!

Saludos @ Madrid

/El Bruno

References

– ReSharper, www.jetbrains.com/resharper

[#VS2015] Some #NuGet new features in Visual Studio 2015

Hello!

Right now work with Visual Studio 2015 is a pleasure. Even if the current version “less than a Beta”, it is rather stable and you can use it to work fine. One of the things that I like most in the new IDE, is the new NuGet window which is not modal.

ng 01

For sure, in the past you get to a point when you need to open the NuGet configuration window in 2 projects at the same time, or open the packages.config in text mode and NuGet window. Now you can.

ng 02

Another thing interesting is that now you can manage almost everything related to a project with NuGet. Usually we are used to to working with references and packages, however we can now also define the runtime execution and more.

It is pretty cool to be able to select for example, the runtime of Roslyn and added to a project with a specific version.

ng 03

Finally we also have different types of behaviors when at the time of updating a package we have conflict, or we can even define opposite types of releases are us suggest an update.

Kudos to the team of Visual Studio 2015 and the cracks of NuGet 😉

Greetings @ Home

/El Bruno

[#VS2015] Algunas novedades de #NuGet en Visual Studio 2015

Hola!

La verdad es que trabajar con Visual Studio 2015 es un placer. Si bien está en “menos que beta”, es bastante estable para poder trabajar. Una de las cosas que más me gusta del nuevo IDE es que la ventana de NuGet no es modal.

ng 01

Seguramente en algún momento has necesitado tener abierto la configuración NuGet de 2 proyectos al mismo tiempo o abrir en modo texto el packages.config y la ventana de NuGet, pues … ahora puedes.

ng 02

Otra de las cosas interesantes es que ahora casi todo lo relacionado con un proyecto, se puede gestionar con NuGet. Usualmente estamos acostumbrados a trabajar con las referencias y paquetes, sin embargo ahora podemos definir también el runtime de ejecución y otras cosas más.

Es bastante cool esto de poder seleccionar por ejemplo, el runtime de Roslyn y agregarlo con una versión específica a un proyecto.

ng 03

Finalmente también tenemos diferentes tipos de comportamientos cuando al momento de actualizar un paquete tenemos conflictos, o inclusive podemos definir frente a que tipos de nuevas versiones se nos sugerirá una actualización.

Kudos para el equipo de Visual Studio 2015 y para los cracks de NuGet 😉

Saludos @ Home

/El Bruno