Object must implement IConvertible (InvalidCastException) while casting to interface
I'm trying to cast an object of a certain type to an interface it implements using `Convert.ChangeType()`, however an `InvalidCastException` gets thrown because . The types: ``` public IDocumentSet ...
- Modified
- 16 Sep at 11:28
bulk creating keys in Redis C# - SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
I'm bulk creating keys in Redis dB under multi-threading environment for some reason in my ASP.NET MVC Web Application. And I'm using [ServiceStack.Redis](https://github.com/ServiceStack/ServiceStack....
- Modified
- 20 Jun at 09:12
Force HttpWebRequest to send client certificate
I have a p12 certificate, that I load it in this way: ``` X509Certificate2 certificate = new X509Certificate2(certName, password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Persi...
- Modified
- 16 Sep at 10:15
Reading SQL Varbinary Blob from Database
I am working on saving files to sql blob to a varbinary(max) column, and have got the save side of things working now (I believe). What I can't figure out is how to read the data out, given that I'm ...
- Modified
- 27 Sep at 16:13
How to retrieve output parameter from stored procedure by EF code first
i am new in EF and working with EF code first. just got a link [https://code.msdn.microsoft.com/How-to-retrieve-output-e85526ba](https://code.msdn.microsoft.com/How-to-retrieve-output-e85526ba) which ...
- Modified
- 16 Sep at 08:37
Json.net serialize numeric properties as string
I am using JsonConvert.SerializeObject to serialize a model object. The server expects all fields as strings. My model object has numeric properties and string properties. I can not add attributes to ...
Method that returns Task<string>
I need a method that returns a `Task<string>` with empty string like ``` public static Task<string> AsyncTest() { return new Task<string>(() => string.Empty); //problem here // this me...
How to fill a dictionary with all request headers
Im able to get request headers one by one when I have the header key name with this method ``` private string GetHeader(string Name) { IEnumerable<string> headerValues; if (Request.Headers.Tr...
- Modified
- 16 Sep at 07:17
Visual Studio Code: How to show line endings
How can I display lineendings (CR,LF) in Visual Studio Code (not in Visual Studio)? At the moment there is only the little statusbar menu which display/change the line ending if the actual file. But s...
- Modified
- 29 Oct at 14:58
Change the speed of animation at runtime in unity c#
The default speed of animation in unity is . I set the default speed value of animation to . And during runtime of program, I want the speed of animation to . ``` using UnityEngine; using System.Co...
Xcode error: Code signing is required for product type 'Application' in SDK 'iOS 10.0'
I have Xcode 8 installed on OS X El Capitan. I get this error: > Signing for "target" requires a development team. Select a development team in the project editor.Code signing is required for product ...
- Modified
- 20 Jun at 09:12
How to get the current CPU/RAM/Disk usage in a C# web application using .NET CORE?
I am currently looking for a way to get the current CPU/RAM/Disk usage in a C# web application using .NET CORE. For CPU and ram usage, I use PerformanceCounter Class from `System.Diagnostics`. This is...
- Modified
- 27 Dec at 03:36
Why are web apps going crazy with await / async nowadays?
I come from a back end / thick client background, so maybe I'm missing something... but I recently looked at the source for an open source JWT token server and the authors went crazy with await / asyn...
- Modified
- 16 Sep at 00:18
NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll
Recently I started to get this error: > NSPhotoLibraryUsageDescription key must be present in Info.plist to use camera roll. I am using React Native to build my app (I am not familiar with ios na...
- Modified
- 18 Nov at 10:42
Make XmlHttpRequest POST using JSON
How can I make an AJAX POST request sending JSON data using vanilla JS. I understand the content-type is url form encoded and it doesn't support nested JSONs. Is there any way I can make such a POST...
- Modified
- 15 Sep at 20:7
userManager.AddToRoleAsync() - Error: role does not exist
I'm creating a user registration system using .NET Core, Identity Core, and MVC Core. I'm able to create users and create roles in the database. Here's the form on the view that lets me select a user...
- Modified
- 21 Sep at 20:19
Using async / await inside .Select lambda
I am using Asp.Net Core Identity and trying to simplify some code that projects a list of users to a ViewModel. This code works, but in trying to simplify it I have gone into a crazy spiral of error...
- Modified
- 23 May at 11:47
Facebook SDK for .NET Core
Up until now I've been using Facebook SDK for .NET by [https://hackerapp.com/](https://hackerapp.com/) I want to upgrade my project to ASP.NET Core, but I see that their library doesn't have support ...
- Modified
- 16 Mar at 09:38
OData Error: The query specified in the URI is not valid. The property cannot be used in the query option
I'm trying to get an OData endpoint up and working and I'm having this error that even Google doesn't have much to say about. I have created an Entity Framework EDMX context (database first), had the...
- Modified
- 20 Sep at 11:44
How to take input as String with spaces in java using scanner
I need to read spaces (present before string and after String) given as input using Scanner Note : if there is no spaces given in input it should not add space in output Please find the below code:...
- Modified
- 17 Sep at 22:42
Bulk create keys in Redis - ServiceStack C#
Is there any way to bulk-create keys (`SETS`) in ""? Of course, without putting `for` loop. There is one command in Redis which does this: [MSET](http://redis.io/commands/mset) but, I couldn't fin...
- Modified
- 16 Sep at 07:6
Get current date in Swift 3?
How can I set label.text current date in Swift 3? I want to print just today to the screen. I did not find how to do that. In c# is very simple: ``` var date = DateTime.Now ``` I need to write 1...
Deploying entity framework code first with production database
I've developed a pretty simple web app using entity framework code first. I realized after hours of frustration that even though localdb is SQL Server Express it is actually not meant to be used with ...
- Modified
- 15 Sep at 14:6
Is there any difference between the Ok() method new ObjectResult()?
Scenario: implementing a standard REST API / GET method on a .net core controller. The [documentation](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.okobjectresult) states that...
- Modified
- 21 Apr at 08:32
Exposing .NET events to COM?
I've been trying to expose and fire an event to a VBA client. So far on the VBA client side, the event is exposed and I see the method event handling method added to my module class however the VBA ev...