Error: 'types' can only be used in a .ts file - Visual Studio Code using @ts-check

I am starting to use TypeScript in a Node project I am working on in Visual Studio Code. I wanted to follow the "opt-in" strategy, similar to Flow. Therefore I put `// @ts-check` at the top of my `.js...

How to use .settings files in .NET core?

I'm porting an application to .NET core which relies on a `.settings` file. Unfortunately, I can't find a way to read it from .NET core. Normally, adding the following lines to the `.csproj` would gen...

17 Jul at 08:42

Disable "Name can be simplified" IDE0003 fix hint

Visual Studio 2017 shows a hint for unnecessary `this` qualifiers even when the inspection is disabled in the options. This is how it looks: ![](https://i.stack.imgur.com/5zEiK.png) (First line is th...

19 Feb at 00:6

.NET Core Singleton Creation is called multiple times

I'm registering a service as a singleton in .NET Core. Yet I'm seeing the constructor for the singleton called multiple times. ``` services.AddSingleton<DbAuthorizationOptions, ContextAuthorizationO...

C# How to Open HEIC Image

I have an image upload form in ASP.NET that supports JPG/PNG/GIF and I thought it would be enough. Until Apple introduced their new HEIC image format. How do I handle that in C#? Searching for C# and...

18 Feb at 17:32

How to debug "You do not have permission to view this directory or page"?

After I published an ASP.NET Core app to Azure from Visual Studio 2017 I am getting this message when I click on the app url: [](https://i.stack.imgur.com/8sSbyh.jpg) It was working fine before. Is th...

6 Mar at 13:48

Usage of Fody/Costura and Obfuscar in Visual Studio 2017

I would like to ask if it is possible to use [Fody-Costura](https://github.com/Fody/Costura), which embeds dependencies into the executable and [Obfuscar](https://github.com/lextm/obfuscar), for obfus...

Tensorflow estimator ValueError: logits and labels must have the same shape ((?, 1) vs (?,))

I'm classifying movie reviews as positive or negative using binary crossentropy. So, when I'm trying to wrap my keras model with tensorflow estimator, I get the error: ``` Tensorflow estimator ValueEr...

30 Mar at 09:29

Is the Chain of Responsibility used in the .NET Framework?

I am trying to learn more about the Chain of Responsibility design pattern. Every single example I see online gives the simplest example i.e. a Logger that writes a different message to the Console de...

6 May at 18:46

How to set default content-type to Json with servicestack serializer

I want if client did not provide content-type in calling web api, in server side set that to application/json, I found this : ``` SetConfig(new HostConfig { PreferredContentTypes = new []{ MimeTy...

How to reference Microsoft.JQuery.Unobtrusive.Ajax within my ASP.NET Core MVC project

I am trying to use `Microsoft.JQuery.Unobtrusive.Ajax`. I started by installing the package using NuGet and as expected I am able to see it among my dependencies. [](https://i.stack.imgur.com/i5F87.j...

package org.springframework.boot does not exist

I am trying to run a Small basic Spring boot program on my machine and I when I run `clean compile` (even before trying spring-boot:run) on maven I get the following Error : ``` [INFO] --------------...

18 Feb at 03:22

Module not found: Can't resolve 'bootstrap/dist/css/bootstrap-theme.css' in 'C:\react-form-validation-demo\src'

I am newbie in react.js. I have been following instruction in [how-to-do-simple-form-validation-in-reactjs](https://learnetto.com/blog/how-to-do-simple-form-validation-in-reactjs) and I can run [http:...

27 Aug at 22:11

How do I correctly use EF Core with AutoMapper ProjectTo and Unions?

## My Setup - - - --- ## Problem I have a project with a DTO called `PersonDetail` and an Entity called `Person`. When I call ``` db.People.Where(p => p.FirstName == "Joe").Union(db.P...

Store files in database using Entity Framework Core

How to store files in a SQL Server database using Entity Framework Core (Code-First) in an ASP.NET Core app? I have tried using `Filestream` but unfortunately I get this error: > Cannot call Propert...

How to use string interpolation in a resource file?

I would like to use a resource file to send an email. In my resource file I used a variable "EmailConfirmation" with the value "Hello {userName} ... " In my class I used: ``` public static string me...

ServiceStack and .NET Core Middleware

I wonder if it is possible to use ServiceStack on .NET core along with middleware. My use case is that I'd like to have API implemented with ServiceStack, and use authorisation policies and openid co...

What exactly is 'UseAuthentication()' for?

I have a question regarding authentication in ASP.NET Core 2: what exactly is the call for? Is it a basic prerequisite so that I can implement my custom authentication logic? I already had a look a...

How to use Functions of another File in Dart / Flutter?

I have a Flutter app where I'm using the flutter_web_view package. I'm using it over several different files and would love to create its own file and simply reference with the _launchwebview functio...

18 Feb at 06:48

Failing to understand what the expression *(uint32_t*) does

I am failing to understand what the expression `*(uint32_t*)` does. I have broken the statement down to an example that declares the parts so I can try and interpret what each one does. ``` uint32_t* ...

28 Sep at 00:22

Error when running unit tests in visual studio: Test-case objects missing

I'm getting the following error when running unit tests from visual studio using resharper: `Test-case objects missing for the following elements: ... Rebuild the project and try again` In the tool...

Dynamically change a type with C#

I am very new to C# and ServiceStack and I am working on a small project that consists on calling a third party API and loading the data I get back from the API into a relational database via ServiceS...

16 Feb at 08:51

Dockerfile can't see local file or private nuget server

I am trying to start my .net core web api on container tech. using docker. Environments=Windows 10,Visual Studio Docker version: > Client:Version: 17.12.0-ceAPI version: 1.35Go version: ...

16 Feb at 07:29

FtpWebRequest 30 minute time out

My code is experiencing a time out exception after exactly 30 minutes when downloading a large file over FTP. The server is [FileZilla](https://filezilla-project.org/) running on Windows. We have an S...

27 Feb at 15:53

How to access Route Data / Value Provider data in a service in ASP.NET Core?

I am attempting to write a [Policy-based Authorization Handler](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/policies). The business logic of the handler needs to use the recor...