VS 2015 SSIS Script Tasks cannot be debugged
Just spent hours pulling my hair trying to work out why my ssis Script Component was not breaking into debugger on hitting a breakpoint. I searched the web and fund 64 bit setting (Project -> Properie...
- Modified
- 30 Oct at 20:44
What is the difference between "x is null" and "x == null"?
In C# 7, we can use ``` if (x is null) return; ``` instead of ``` if (x == null) return; ``` Are there any advantages to using the new way (former example) over the old way? Are the semantics any di...
- Modified
- 21 Oct at 02:28
Reference operators in XML documentation
I would like to reference an operator in a `<see cref="..." />` [XML documentation](https://msdn.microsoft.com/en-us/library/b2s063f7.aspx) tag, but I can't seem to find any hints on how to do it. The...
- Modified
- 20 Jun at 09:12
Load* POCO references using OrmLite and SQL
I have a few questions about ServiceStack.OrmLite's POCO reference capabilities. 1. When using the Load*() API to fetch POCO with references, does it internally generate & run a single SQL query (wi...
- Modified
- 18 Nov at 08:25
How can I manually check the url authorization in MVC5?
To restrict the access to an web app, an Administrator is able to set the url authorization of users and groups via the IIS-Manager: [](https://i.stack.imgur.com/jJFvf.png) The IIS-Manager store...
- Modified
- 22 Nov at 14:42
ASP.NET Core Select Helper Throws Object Reference not set to an instance of an Object
I've created an ASP.NET Core web application that uses Entity Framework Core to read from my existing database. I want to populate a select control with a list of FacilityNames in a view to create a ...
- Modified
- 18 Nov at 00:24
Unrecognized C# syntax
Let's say we have: ``` class Foo { public int IntPropertyInFoo { get; set; } public Bar BarPropertyInA { get; set; } } class Bar { public string StringPropertyInBar { get; set; } } ``` ...
Prompt file download
I have a link on my page on click of which I am trying to generate a PDF document and then show the "Open - Save" prompt on the browser. My HTML (reactjs component) has the below code where `onclick`...
- Modified
- 13 Oct at 19:47
SqlConnection.Open vs SqlConnection.OpenAsync - what's different between the two beyond the obvious?
This boils down to why does changing just SqlConnection.Open() to await SqlConnection.OpenAsync() within asynchronous code result in strongly different behavior. What's the difference between a SqlC...
- Modified
- 17 Nov at 20:40
Update claims in ClaimsPrincipal
I am using Adal with Azure Active Directory and I need to add extra claims via custom OwinMiddleware. When I add claims to this principal, I am able to access them in the current request. But after a ...
- Modified
- 18 Nov at 15:27
AutoMapper - What's difference between Condition and PreCondition
Suppose a mapping using AutoMapper like bellow: ``` mapItem.ForMember(to => to.SomeProperty, from => { from.Condition(x => ((FromType)x.SourceValue).OtherProperty == "something"); from.MapFro...
- Modified
- 14 Feb at 13:10
How to add Persistent Listener to Button.onClick event in Unity Editor Script
I am trying to do a simple thing: 1. Create a new GameObject 2. Add a Button component to the GameObject. 3. Add a persistent Listener to Button's OnClick event. The method I am trying to register ...
Register Service at Runtime via DI?
I am using ASP.NET Core and want to add a service to the IServiceProvider at runtime, so it can be used across the application via DI. For instance, a simple example would be that the user goes to th...
- Modified
- 17 Nov at 13:27
How to stop Chrome's Select a certificate window?
I'm working on a Selenium project and the system I need to test is using an SSL certificate. Every time when I try to login we are getting this "Select a certificate" window which we cannot handle wit...
- Modified
- 21 Jan at 01:47
What is the difference between Microsoft.Spatial and System.Spatial libraries
I would like to know what is the difference between two spatial libraries - Microsoft.Spatial and System.Spatial? When I'm looking into the code of those two I see almost the same classes. Both has f...
- Modified
- 17 Nov at 10:13
How do I declare a C# anonymous type without creating an instance of it?
Is there a better way that can I declare an anonymous type, without resorting to create an instance of it? ``` var hashSet = new [] { new { Name = (string)null } }.Take(0).ToHashSet(); // HashSet<T>...
- Modified
- 17 Nov at 11:30
Performance: .Join vs .Contains - Linq to Entities
I am using Linq to entities to query the database to get the list of int for further processing. I have two ways to get the list as below: ``` List<int> lstBizIds = new List<int>() { 1, 2, 3, 4, 5 ...
- Modified
- 17 Nov at 09:32
Type or namespace name Mock<> could not be found Entity Framework 6
I am trying to mock my `DbContext` for writing my unit tests. I saw a tutorial, and tried to do it like the following: ``` [TestMethod] public void MyFirstTest() { var mockSet = new Mock<DbSet<V...
- Modified
- 10 Aug at 07:56
ASP.NET Core Authorize attribute not working with JWT
I want to implement JWT-based security in ASP.Net Core. All I want it to do, for now, is to read bearer tokens in the `Authorization` header and validate them against my criteria. I don't need (and do...
- Modified
- 29 Mar at 05:38
Service Stack Swagger 2.0 and Azure Api Management Import
I am trying to import my Service Stack swagger.json into an Azure Api Management instance. Its failing with "One or more fields contain incorrect values: Parsing error(s): The Swagger version specifie...
- Modified
- 17 Nov at 02:45
Rename model in Swashbuckle 6 (Swagger) with ASP.NET Core Web API
I'm using Swashbuckle 6 (Swagger) with ASP.NET Core Web API. My models have DTO as a suffix, e.g., ``` public class TestDTO { public int Code { get; set; } public string Message { get; set; }...
- Modified
- 13 Aug at 12:6
Using [JsonProperty("name")] in ModelState.Errors
We have a couple of models that override the name via JsonProperty, but this causes an issue when we get validation errors through ModelState. For example: ``` class MyModel { [JsonProperty("id")...
- Modified
- 16 Nov at 20:36
Which is better to catch all exceptions except given types: catch and rethrow or catch when?
If I wanted to catch all exceptions except for given types, and those specific types would be re-thrown to be caught in a higher context, would it be better to do: ``` try { //Code that might thr...
Servicestack migration to core, fallback router and HandlerFactoryPath
Im migrating my code to a core application. So far so good. i got it all running, but there is one problem. I had a ui (with razor) and using the `CatchAllHandlers`. And for the api i used `HandlerF...
- Modified
- 16 Nov at 12:38
ASP.NET How read a multipart form data in Web API?
I send a multipart form data to my Web API like this: ``` string example = "my string"; HttpContent stringContent = new StringContent(example); HttpContent fileStreamContent = new StreamContent(strea...
- Modified
- 16 Nov at 12:19