Category: Microservices
-
Failed to load the development https certificate using docker and ocelot
Hey everyone, I randomly started encountering the following error while using docker to host my Ocelot gateway: Failed to load the development https certificate at ‘/root/.aspnet/https/ContentGateway.pfx’. The solution ended up being to clean out as many temp files as possible, especially the generated certs: Delete the following files: Delete the C:\Users{USER}\AppData\Roaming\ASP.NET\Https folder Clean the solution.…
-
“protobuf” visual studio a namespace cannot directly contain members such as fields or methods
Hi everyone, I ran into the following intellisense error while adding a new proto file: “protobuf” visual studio a namespace cannot directly contain members such as fields or methods This was one of many errors that were shown and appeared to be an issue with Intellisense mistaking the file for a normal class definition. The…
-
Docker – Severity Code Description Project File Line Suppression State Error DT1001 Service service has neither an image nor a build context specified. At least one must be provided. docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets 204
Hi everyone, I ran into the following error while using docker compose and visual studio: Severity Code Description Project File Line Suppression State Error DT1001 Service has neither an image nor a build context specified. At least one must be provided. docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker.Compose.targets 204 It took a bit of poking around…
-
Http gRPC with .NET Core and Docker – Error starting gRPC call. System.Net.Http.HttpRequestException: An error occurred while sending the request. —> System.IO.IOException: The response ended prematurely.
Hi everyone, I’ve been mucking around with gRPC today while using .NET Core and Docker. I have two Microservices in the setup, one server and one client. Because these services will only be communicating internally I intended to use HTTP instead of HTTPS. Unfortunately, I hit the following error while attempting to set this up:…
-
eShopOnContainers – No parameterless constructor defined for type dbcontext
Hi everyone, Another eShopOnContainers post. Today I was setting up migrations and ran into the following error: Found DbContext ‘CatalogContext’. Microsoft.EntityFrameworkCore.Design.OperationException: Unable to create an object of type ‘CatalogContext’. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728 —> System.MissingMethodException: No parameterless constructor defined for type ‘Catalog.Api.Infrastructure.CatalogContext’. at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)…
-
‘DatabaseFacade’ does not contain a definition for ‘Migrate’ and no accessible extension method ‘Migrate’… – eShopOnContainers
Hi everyone, I’ve been going through Microsoft’s eShopOnContainers repo and replicating it as a small test project to learn microservices. While adding the WebHost Customization project I ran into the following error: Severity Code Description Project File Line Suppression State Error CS1061 ‘DatabaseFacade’ does not contain a definition for ‘Migrate’ and no accessible extension method…
-
Prevent Hot-Chocolate Schema Polling from Spamming Logs – GraphQL
Hi everyone, I’m currently toying around with GraphQL on with HotChocolate on .NET Core Microservices. After implementing logging I ran into a bit of a problem every time I opened the GraphQL playground. While observing my logs I noticed that an almost continuous stream of Schema logs were appearing which made it fairly difficult to…
-
error : “Timestamp” is not defined. – .net core and gRPC
Hi everyone, I’m currently testing out gRPC with .NET Core and hit the following error when attempting to add a timestamp field to my proto file: error : “Timestamp” is not defined. My proto file was as follows: syntax = “proto3”; import “google/protobuf/timestamp.proto”; option csharp_namespace = “publisher_api”; package Weather; // The weather forecast service definition…
-
Current .NET SDK does not support targeting .NET Core 3.0 – Microservices
Hi everyone, I’m currently learning microservices with .Net Core. As part of this I’ve been following one of Microsoft’s tutorials: https://dotnet.microsoft.com/learn/aspnet/microservice-tutorial It has all been pretty straight forward, however I hit an error when attempting to run docker build: RUN dotnet restore —> Running in 734e82e92c23 /usr/share/dotnet/sdk/2.2.207/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not…