Using connection string from appsettings.json to startup.cs
Currently in Startup, I have my sql server string looking like this: ``` public void ConfigureServices(IServiceCollection services) { var connection = @"Server=servername;Database=database;Truste...
- Modified
- 16 Aug at 11:5
FromBody string parameter is giving null
This is probably something very basic, but I am having trouble figuring out where I am going wrong. I am trying to grab a string from the body of a POST, but "jsonString" only shows as null. I also ...
- Modified
- 6 Dec at 10:43
How can I change a PCL into a .net Platform Standard Library in Visual Studio 2017?
I am trying to figure out how to change a portable .net class library into a .net platform standard library. There is a clickable link in the project settings that looks right it says "Target .net pla...
- Modified
- 20 Jun at 09:12
What is deps.json, and how do I make it use relative paths?
I'm setting up an ASP.NET Core project on TeamCity. The binaries it builds crash on startup on other machines. The error message shows that it is looking for dlls in paths that only exist on the build...
- Modified
- 5 Dec at 10:28
What is the best way to create a new field for UserAuth?
I would like to create a `DefaultPrinterId` property (field) attached on `UserAuth` table. This `DefaultPrinterId` field is a foreign key on a `Printer.Id` field (`Printer` is a custom table). My que...
- Modified
- 28 Nov at 16:56
Failure of delegation of Google Drive access to a service account
I've been involved with building an internal-use application through which users may upload files, to be stored within Google Drive. As it is recommended not to use service accounts as file owners, I ...
- Modified
- 2 Dec at 09:44
ServiceStack.Api.Swagger SwaggerResourcesService excluding Routes begining with Route Parameter
I am using Servicestack version 4.0.52.0 and ServiceStack.Api.Swagger 4.0.0.0 I have defined all routes with variable route parameter in serviceStack application host derived class(AppHostBase):Conf...
- Modified
- 28 Nov at 16:59
How to read a connectionString WITH PROVIDER in .NET Core?
I added ``` .AddJsonFile("Connections.json", optional: true, reloadOnChange: true) ``` in ``` public Startup(IHostingEnvironment env) ``` Connections.json contains: ``` { "ConnectionStrings...
- Modified
- 28 Nov at 17:11
Servicestack convert IServiceCollection into Funq entries
Does the servicestack.core package contain a [https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection#replacing-the-default-services-container](https://learn.microsoft.com/en-u...
- Modified
- 28 Nov at 13:26
"if (object is (string, Color))" c# 7.0 tuple usage doesn't work
I'm using Visual Studio 2017 RC and I have installed the `System.ValueTuple` package which enables the new c# 7.0 tuple usage, but I can't make it work in this specific case: [](https://i.stack.imgur...
- Modified
- 27 Nov at 18:37
VSTO Word 2016: Squiggly underline without affecting undo
I am working on a real-time language analysis tool that needs to highlight words to draw attention from the writer in Word 2016 using a VSTO add-in, written in .NET4.6.1 with C#. Think of the grammar/...
ASP.NET Core Model Binding Error Messages Localization
I'm using ASP.NET Core, and trying to localize the application. I managed to use asp .net core resources to localize controllers and views, and resources to localize error messages for model validat...
- Modified
- 16 Jan at 04:56
ViewModel concept still exists in ASP.NET MVC Core?
In previous versions of ASP.NET MVC you find some informations about ViewModels and how to use them in this version. I'm wondering why I can't find any information about this topic in ASP.NET Core M...
- Modified
- 9 Apr at 17:39
Unable to return Tuple from a method using Visual Studio 2017 and C# 7.0
I've installed Visual Studio 2017 Community that was released a week ago, and I started exploring the new features of C# 7. So I created a simple method that returns two values: ``` public class Pro...
- Modified
- 11 Aug at 22:46
How generate list of string with Bogus library in C#?
I use [Bogus](https://github.com/bchavez/Bogus) library for generate test data. for example I have a class : ``` public class Person { public int Id {get; set;} public List<string> Phones {get...
- Modified
- 26 Nov at 17:11
HTTP Error 500.19 when publish .net core project into iis with 0x80070005
[](https://i.stack.imgur.com/vbZ03.png) I want to publish a sample .net core web application on my pc's IIS manager but I failed. I am using Microsoft guidance but it doesn't work for me, if you have...
- Modified
- 29 May at 01:41
Could not Cast or Convert System.String to Class object
I am trying to deserialize a JSON string received from a Web API ``` try { string r = await App.client.GetUser(); App.Authentication = JsonConvert.DeserializeObject<ApiResult>(r); await...
- Modified
- 9 Jun at 00:34
Manually decode OAuth bearer token in c#
In my Web Api 2.2 OWIN based application I have a situation where I manually need to decode the bearer token but I don't know how to do this. This is my startup.cs ``` public class Startup { pub...
- Modified
- 25 Nov at 08:3
Use Blockly inside a WPF WebBrowser
Is it possible to use the Blockly google javascript libraries inside a WPF WebBrowser? In particular, Blockly needs [several js scripts](https://developers.google.com/blockly/guides/configure/web/fix...
- Modified
- 1 Aug at 22:5
How to read FormData into WebAPI
I have an ASP.NET MVC WebApplication where I am using the ASP.NET Web API framework. ``` var data = new FormData(); data.append("filesToDelete", "Value"); $.ajax({ type: "POST", url: "...
- Modified
- 22 May at 09:24
AmbiguousActionException: Multiple actions matched. The following actions matched route data and had all constraints satisfied
I am creating a website using ASP.NET Core MVC. When I click on an action I get this error: ``` AmbiguousActionException: Multiple actions matched. The following actions matched route data and had a...
- Modified
- 28 Sep at 00:11
Is an upsert in mongodb atomic with the filter and the actual update
I have a document I want to upsert. It has a unique index on one of the properties, so I have something like this to ensure I get no collisions ``` var barVal = 1; collection.UpdateOne( x=>x.Ba...
- Modified
- 24 Nov at 21:18
Visual Studio Code compile error - launch.json must be configured
I am trying to compile c# code on windows 7 using visual studio code. I have all the extensions downloaded but am getting this error: > launch: program 'launch: launch.json must be configured. Change...
- Modified
- 24 Nov at 19:12
Do not know how to use coroutines in Unity3D
In Unity3D, this is my code: Everytime a player run into a power up one of the ActivateBuff Methods gets called. Obviously powerUps effects don't last forever though so I used `IEnumerators` to revers...
- Modified
- 7 May at 03:59
Current JsonReader item is not an object
First I made an application and then I've started doing test for it ( Know it is not good way ), everything works fine with parsing etc, but after i made few test got an error : > Newtonsoft.Json.Jso...
- Modified
- 24 Nov at 23:13