How to serialize data into indented json
I am using this code to serialize the users into `json` text file. ``` if (File.Exists(path)) { using (var file = File.CreateText(path)) { var serializer = new JsonSerializer(); ...
How to create T4 text templates(.tt) in ASP.NET core on Visual Studio 2015
I want to create T4 text templates to achieve code generation. All the tutorials I found on msdn suggest following to add a new text template: `Add > New Item > Text Template`, (eg [https://msdn.micro...
- Modified
- 12 May at 23:16
How do I navigate to a parent route from a child route?
My problem is quite classic. I have a private part of an application which is behind a `login form`. When the login is successful, it goes to a child route for the admin application. My problem is th...
- Modified
- 27 Mar at 16:10
How can I persist redux state tree on refresh?
The first principle of Redux documentation is: > The state of your whole application is stored in an object tree within a single store. And I actually thought that I understand all of the principles w...
How to view log output using docker-compose run?
When I use `docker-compose up` I can see logs for all containers in my `docker-compose.yml` file. However, when I use `docker-compose run app` I only see console output for `app` but none of the serv...
- Modified
- 12 May at 18:51
Service Stack inject object
i´m doing an app, using ServiceStack. I could inject an object without problems, but, the object can be modified outside the Service Class, so, i need to re inject again Here is the code: ``` public ...
- Modified
- 12 May at 16:32
Build failing on .net Core app due to missing definition
I'm trying to build my .NET Core app from the CLI using `dotnet build`, but every single time I get this error: > 'IConfigurationBuilder' does not contain a definition for 'AddEnvironmentVariables' ...
- Modified
- 28 Oct at 14:7
Dependency Injection with classes other than a Controller class
At this point I'm injecting things into my Controllers with ease, in some cases building my own ResolverServices class. . What I cannot figure out how to do is get the framework to automatically injec...
- Modified
- 29 Aug at 17:22
String Object with fixed length C#
I have a class wherein I want to use Strings with a fixed size. The reason for the fixed size is that the class "serializes" into a textfile with values with a fixed length. I want to avoid to write f...
Error:could not create the Java Virtual Machine Error:A fatal exception has occured.Program will exit
I have just installed Java SE Development Kit 8u91 on my 64 bit Windows-10 OS. I set my variables . I tried in my command prompt it gave me an error. ``` c:\Users\Onlymanu>java --version Unrecogniz...
C# Time complexity of Array[T].Contains(T item) vs HashSet<T>.Contains(T item)
`HashSet(T).Contains(T)` (inherited from [ICollection<T>.Contains(T)](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1.contains)) has a time complexity of O(1). So...
- Modified
- 8 Mar at 14:10
How do I disable Git Credential Manager for Windows?
I notice that in the latest version of Git, the default is now to popup a "Git Credential Manager for Windows" dialog instead of prompting me for me password at the Bash prompt every time. I really h...
Create Merge Cells using OpenXML
Please consider this Excel: [](https://i.stack.imgur.com/MOh2b.png) and it's XML: [](https://i.stack.imgur.com/NoKsv.png) I want to create such this Excel that has multiple merged cells using Open...
- Modified
- 12 May at 09:8
ServiceStack Server Side Events and IIS AppPool Crash
I am wondering if anyone could help me with some insight / thoughts on an issue we are experiencing with IIS crashes that may be linked with Service Stack Server Side Events? Our application uses Ser...
- Modified
- 12 May at 07:13
How to (repeatedly) read from .NET SslStream with a timeout?
I just need to read up to `N` bytes from a `SslStream` but if no byte has been received before a timeout, cancel, while leaving the stream in a valid state in order to try again later. (*) This can b...
- Modified
- 15 May at 02:20
C# equivalent to Java 8 "method reference"
I recently had the opportunity to tweak some Java code and was able to take advantage of some new Java 8 features. In one particular case I needed to get a List of (String) `.Name` properties from a L...
Swagger-Codegen custom settings
I am using `swagger-codegen` to generate my client-side C# classes. It does the job, but there are a few things I'd like to customize: 1) Most importantly, how I tell it which namespace, or perhaps...
- Modified
- 3 May at 18:34
Events and multithreading once again
I'm worried about the correctness of the seemingly-standard pre-C#6 pattern for firing an event: ``` EventHandler localCopy = SomeEvent; if (localCopy != null) localCopy(this, args); ``` I've r...
- Modified
- 23 May at 12:1
angular-cli server - how to proxy API requests to another server?
With the `angular-cli` `ng serve` local dev server, it's serving all the static files from my project directory. How can I proxy my AJAX calls to a different server?
- Modified
- 26 Jul at 12:41
.NET Core/EF 6 - Dependency Injection Scope
I am currently working on setting up a .NET Core application using EF 6, and am having some trouble understanding the appropriate use of the various dependency registration methods. As I understand i...
- Modified
- 12 May at 14:58
Create a cryptographically secure random GUID in .NET
I want to create a cryptographically secure GUID (v4) in .NET. .NET's `Guid.NewGuid()` function is not cryptographically secure, but .NET does provide the `System.Security.Cryptography.RNGCryptoServi...
How to combine AutoDataAttribute with InlineData
I heavily use the Autofixture AutoData Theories for creating my data and mocks. However this prevents me from using the InlineData Attributes from XUnit to pipe in a bunch of different data for my tes...
- Modified
- 11 May at 17:9
Alert Dialog in ViewModel - MVVMCross
In the `ViewModel`, I have `Save` method where I check `isValid` property. If `isValid` is `false`, then I want to display an error message. Since `AlertDialog` is platform specific, I wonder how d...
How to make EF-Core use a Guid instead of String for its ID/Primary key
When I look at the ASP.NET 3 Identity it uses a `string` and not a `Guid` for the unique primary key. In my `Entity Framework` `code first` Users' `ApplicationUser` class I inherit the Identity clas...
- Modified
- 9 Sep at 13:27
is there any alternative for ng-disabled in angular2?
I am using angular2 for development and was wondering if there is any alternative for `ng-disabled` in angular2. For ex. below code is in angularJS: ``` <button ng-disabled="!nextLibAvailable" ng-c...
- Modified
- 24 Aug at 13:26