Questions

How to implement Security Protocols TLS 1.2 in .Net 3.5 framework

As Paypal updated their response, I need to update security protocols TLS to v1.2 in my existing application which is on .NET 3.5 framework. What changes required to update this in existing code, I c...

27 Feb at 11:41

Waiting until the task finishes

How could I make my code wait until the task in DispatchQueue finishes? Does it need any CompletionHandler or something? ``` func myFunction() { var a: Int? DispatchQueue.main.async { ...

The operation could not be completed. invalid pointer - Visual Studio 2015 Update 3

[](https://i.stack.imgur.com/HIEcu.jpg) Getting this error when opening `.cshtml` file: > The operation could not be completed. Invalid pointer Everything starts after installing update 3 and .Net ...

Does C# 7.0 work for .NET 4.5?

I created a project in Visual Studio 2017 RC to check whether I can use new C# 7.0 language features in a .NET Framework 4.5 project. It seems to me that after referencing `System.ValueTuple` NuGet, n...

27 Feb at 14:33

ServiceStack Log4NetFactory

How can I configure log4net in code when I like to use the servicestack logging interface? I see there is ``` LogManager.LogFactory = new Log4NetFactory(configureLog4Net:true); ``` If I got things...

27 Feb at 08:56

Can't auto-generate IDENTITY with AddRange in Entity Framework

I don't know if it's an Entity Framework's desing choice or a wrong approach on my behalf, but whenever I try to AddRange entities to a DbSet I can't seem to get the auto-generated IDENTITY fields. `...

Sending json data to client from an interface server without change

I have two type of servers which contain some information. One of them is that is used for collecting all information in one place and pass it to mobile devices. I used `httpClient` to get JSON data ...

Python Selenium Chrome Webdriver

I'm beginning the automate the boring stuff book and I'm trying to open a chrome web browser through python. I have already installed selenium and I have tried to run this file: ``` from selenium im...

Visual Studio : can't find "resource file" in list of items to add to project

I'm on VS Community 2017 RC. I'd like to add a resource file (.resx) to my project but this item type is not listed in the items[](https://i.stack.imgur.com/HeDFc.jpg) Have I missed something ? Do I ...

How to create roles in ASP.NET Core and assign them to users?

I am using the ASP.NET Core default website template and have the authentication selected as "Individual User Accounts". How can I create roles and assign it to users so that I can use the roles in a ...

convert image into blob using javascript

I use promise to download an image and get the image data like: ``` promise.downloadFile().then(function(image){ //do something }); ``` I have got the image, which is like: ```...

3 Oct at 09:41

xUnit and multiple data records for a test

I'm fairly new to Unit Testing and have the following code: ``` public class PowerOf { public int CalcPowerOf(int @base, int exponent) { if (@base == 0) { return 0; } if (exponent ...

9 Jul at 12:51

How do I change the background color of the body?

I'm using React.js and want to change the background color of the entire page. I can't figure out how to do this. Please help, thank you. Edit (Sep 2 '18): I have a project on GitHub that I'm linking...

2 Sep at 14:31

Wrapping a react-router Link in an html button

Using suggested method: [This is the result: A link in the button](https://i.stack.imgur.com/lN4AP.png), [Code in between comment lines](https://i.stack.imgur.com/aykeJ.png) I was wondering if there ...

27 Dec at 22:10

How to deploy a React App on Apache web server

I have created a basic React App from [https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm](https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm) here , I want to run this test code on Apache bas...

21 Dec at 21:33

Return file in ASP.Net Core Web API

## Problem I want to return a file in my ASP.Net Web API Controller, but all my approaches return the `HttpResponseMessage` as JSON. ## Code so far ``` public async Task<HttpResponseMessage> ...

How to remove text between multiple pairs of brackets?

I would like to remove text contained between each of multiple pairs of brackets. The code below works fine if there is only ONE pair of brackets within the string: ``` var text = "This (remove me) w...

25 Feb at 19:5

How to set build .env variables when running create-react-app build script?

I'm using the following environment variable in my create-react-app: ``` console.log(process.env.REACT_APP_API_URL) // http://localhost:5555 ``` It works when I run `npm start` by reading a `.env` ...

How to get Column name and corresponding Database Type from DbContext in Entity Framework Core

Suppose I have this table: [](https://i.stack.imgur.com/I7r0V.png) How can I get the column name and database datatype from `DbContext` in Entity Framework Core? Tips 1. The column with name clg...

How to reject in async/await syntax?

How can I reject a promise that returned by an `async`/`await` function? e.g. Originally: ``` foo(id: string): Promise<A> { return new Promise((resolve, reject) => { someAsyncPromise().then((val...

binding a Guid parameter in asp.net mvc core

I want to bind a Guid parameter to my ASP.NET MVC Core API: ``` [FromHeader] Guid id ``` but it's always null. If I change the parameter to a string and parse the Guid from the string manually it ...

26 Feb at 08:21

ServiceStack API service RequiresAnyRole always returns 403 error

I've looked at several examples of ServiceStack's Authentication/Authorization code but I can't seem to get past this issue. I have created a custom `AuthFeature` which derives from `BasicAuthProvid...

ServiceStack register error form CustomUserAuth in CredentialsAuthProvider

searching the Internet I found many examples how to make your users table, everything works, check in on social networks, etc. But I get problem when register's representative missions of Registratio...

24 Feb at 21:36

How do I pass a list as a parameter in a stored procedure?

Looking to pass a list of User IDs to return a list names. I have a plan to handle the outputed names (with a COALESCE something or other) but trying to find the best way to pass in the list of user I...

24 Feb at 23:32

Objects in Scene dark after calling LoadScene/LoadLevel

I completed Unity's roll-a-ball tutorial and it works fine. I changed a couple of materials to make it look better. I also added a C# script that should restart the level when the player falls off of ...

30 Apr at 17:52