Month: May 2020
-
Element does not match nay field or property of Class – MongoDb and .net core
Hey everyone, I ran into the following error today while searching MongoDb for an object: Element ‘Tags’ does not match any field or property of class X. The issue was that there were extra fields on the returned document that were not specified on the mapping target object. A bit of Googling revealed that there…
-
.Net Core Web Api Returning Binary File with No Headers Instead of Expected Response
Hey everyone, A small issue I’ve run into while setting up a .net core web api microservice that also utilises a number of gRPC services. Symptoms were as follows: Response Read via Fiddler – HTTP/1.0 200 This buggy server did not return headers – Value was binary and unable to be read Server logs 03:59:23…
-
Unable to find the target operating system for the project
Hi everyone, I ran into the following error today after updating visual studio 2019 to version 16.6: unable to find the target operating system for the project I tried a fair few things to get this going again and I’m assuming they’re not all necessary, but I’ll list them just in case: – Clean solution…
-
OpenXml Validation Spreadsheet Value Between Two Numbers – C#
Hi everyone, Just a quick post on how to validate a numeric cell to ensure that the value is between two numbers when using OpenXml: // Restrict min and max values var dataValidations = new DocumentFormat.OpenXml.Spreadsheet.DataValidations { Count = 0 }; DocumentFormat.OpenXml.Spreadsheet.DataValidation dataValidation; dataValidation = new DocumentFormat.OpenXml.Spreadsheet.DataValidation { Type = DataValidationValues.Decimal, AllowBlank = false, SequenceOfReferences…
-
“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…