Shane Bartholomeusz

Geek and lover of all things tech related

Tag: .Net (page 1 of 2)

Solved: Dotnet EF CLI ‘Could not execute’ Error

dotnet logo

Problem

The ‘dotnet ef’ CLI command enables developers to work with Entity Framework Core (EF Core) database operations from the standard dotnet command line.

Recently I came across the below error whilst trying to run the ‘dotnet ef’ CLI commands:

$ dotnet ef
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-ef does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

If you have also encountered this error whilst using the Entity Framework commands via the dotnet CLI, then you’re in luck because I’ll be sharing the fix in this article.

Continue reading

Solved: Cognitive Services – Operation returned an invalid status code ‘Unauthorized’

Problem

The Azure Cognitive Services SDK is a set of pre-built services that enable developers to easily and quickly integrate AI capabilities into their applications. It provides a wide range of cognitive services including computer vision, language understanding, speech, and search APIs.

Recently whilst using the Azure Cognitive Services SDK recently, I encountered the below error while trying to consume the Cognitive Services Computer Vision API using the Dotnet SDK.

If you’ve also encountered the same error then you are in luck, because in this post I’ll share the solution that worked for me.

Operation returned an invalid status code ‘Unauthorized’

Continue reading

How To: Generate Swagger REST API Client

Overview

As the web continues to grow and evolve, API’s are where all the magic happens that powers this innovation. REST API’s have become increasingly more favoured by developers for their ease of use over other alternatives (XML I’m looking at you).

Unfortunately, REST API’s can sometimes become a bit unwieldy in terms of documenting them, and consuming them. It is for this reason that Swagger was born! Swagger will autogenerate documentation for your REST API in the form of an Open API specification (swagger.json) document (formerly Swagger Specification). This makes it much easier for developers to understand and consume an API.

Third-party developers can then use the swagger.json specification file to either manually create an API client or auto-generate one for the preferred language of choice.

In this post, I’ll show you how to autogenerate a C# REST API client from a swagger.json in a few easy steps.

Swagger Logo
Continue reading

Solved: Azure Functions Can’t Bind Parameter ‘data’ to Type Error

Problem

Recently I came across an unusual error whilst working with C# Azure Functions. When the Function was executed, the console window showed the following error.

The ‘XXXXXX’ function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method ‘XXXXXX ‘. Microsoft.Azure.WebJobs.Host: Can’t bind parameter ‘data’ to type ‘XXXXXX’.

I checked the Activity function parameter bindings however couldn’t see any obvious issue. However after some head scratching I eventually figured out the source of the issue …

In this post I’ll show you how to resolve this issue.

Azure Functions Logo
Continue reading

How to: Implement Azure Web App Authentication – The Easy Way

Overview

Let’s face it … security is HARD. Implementing authentication and authorization into applications has always been a challenge and a chore for developers. Building a secure application requires strong knowledge across a number of areas.

Thanks to the power of Easy Auth on Microsoft Azure it’s easier than ever to setup secure authentication for your web application with the click of a few buttons… Yep, I’m not kidding!

Ok let’s get started …

Azure App Service Logo
Continue reading

Fixed: WCF Test Client Max Size Error

Problem

When querying a web service using the WCF Test Client you might encounter the below error message. In this article I’ll show you how to resolve this issue.

The maximum message size quota for incoming messages (65536) has been exceeded.

Error message screenshot
Continue reading

Solved: Dynamics 365 Unable to Cast Object Error

Problem:

While testing an existing C# app that connected to our Dynamics 365 environment, we encountered an unusual error after updating the CRM SDK Nuget package used by the app.


System.InvalidCastException: ‘Unable to cast object of type ‘Microsoft.Xrm.Sdk.Entity’ to type ‘XXXX.Xrm.Model.XXXX.’

Dynamics 365 logo
Continue reading

Dynamics 365: The underlying connection was closed

Problem

While upgrading a .NET customisation that interfaced with our client Dynamics 365 online environment (Version 9). I encountered the following error while attempting to fetch some records from our Dynamics 365 instance. Continue reading

.NET Network Tracing

System.Net Tracing

ASP.NET Logo

I recently had to troubleshoot a network communication. My app was unable to call an external service endpoint. Troubleshooting network issues can sometimes be as fun as pulling out your own teeth.

In this post I wanted to share a nifty way to perform low-level troubleshooting, which ultimately saved my bacon.

Continue reading

Topshelf – Windows Services Done Right

What is Topshelf?

Many of you probably have experienced the pain of debugging Windows Service applications. A nice alternative is Topshelf Windows Services.

Topshelf allows developers to write Windows Services which can operate as regular Console applications. This is a great open source product that deserves more recognition in the community and that’s why I decided to write a quick post about it. It makes the overall development experience a much, much better one!

Continue reading
Older posts

© 2024 Shane Bartholomeusz

Theme by Anders NorenUp ↑