Category: Microsoft .Net
-
Finding ASP.Net Core Error Logs on IIS
I don’t think there are many IT tasks more frustrating than troubleshooting Microsoft technologies on Windows. These things are simply not made so that anyone knows what’s going on, and the really brutal stuff happens when you combine Windows, IIS and Asp.Net Core. Correct me if I’m wrong, but by default it’s not configured to…
-

Configuring Orchard Core for AD (AD FS) Authentication
How to set the Orchard Core CMS to use a local domain / Active Directory for authentication? The current Ochard version (1.1) doesn’t seem to support it, at least not that I know… It does support Azure AD but that is a different beast. One way to make it work is to install Active Directory…
-
Implementing Equals() and GetHashCode() in ORM classes with autoincrement keys
The requirements for implementing Equals() and GetHashCode() in .Net are very hard to satisfy and in some areas nearly impossible. There are some situations where an object’s identity inevitably changes, and saving an ORM-mapped object with autogenerated key is a case in point. Making its hash code conform with requirements would require an inordinately large…
-
Running 64-bit Ace OLEDB driver with 32-bit Office
When 32-bit Microsoft Office is installed on 64-bit Windows, there is a problem connecting to OLEDB sources using Microsoft Jet provider from .Net applications (and probably others). A .Net application, unless otherwise instructed, runs as 64-bit on 64-bit OS’s and expects a 64-bit OLEDB provider for Jet. But, since Office is 32-bit, there is no…
-
Fluent API vs. named arguments for readability
Fluent APIs are great to make code readable – should I say, at the expense of verbosity? Because verbosity is, actually, one of the positive traits of being fluent. It is very useful in complex and hard to follow scenarios like data transformation (think LINQ), configuration, testing etc., leading the developer to the solution but…
-
Get content from WPF DataGridCell in one line of code (hack)
How do you get the text displayed in a WPF DataGridCell? It should be simple, but incredibly it doesn’t seem it is: all the solutions given on the ‘net contain at least a page of code (I suppose the grid designers didn’t think anyone would want to get the value from a grid cell). But…
-
Workaround for HQL SELECT TOP 1 in a subquery
HQL doesn’t seem to support clauses like “SELECT TOP N…”, which can cause headaches when for example you need to get the data for the newest record from a table. One way to resolve this would be to do something like “SELECT * FROM X WHERE ID in (SELECT ID FROM X WHERE Date IN…
-
Repository moved temporarily to ‘/viewvc/nhibernate/trunk/’; please relocate
When trying to switch my local Subversion copy of the NHibernate source to a different tag (from 3.1GA to trunk, in this case), I got this error: Repository moved temporarily to ‘/viewvc/nhibernate/trunk/’; please relocate The frustrating thing was that I was trying to relocate to exactly this url. And if I tried others, it said…
-
Visual Studio 2010 cannot reference ManagedDTS dll from SQL Server 2005
A C# project that worked with Visual Studio 2008, when converted to Visual Studio 2010, starts complaining about not being able to find classes defined in Microsoft.SQLServer.ManagedDTS.dll and others. These dlls are contained in the SQL Server 2005. If you try to remove the reference and add it again, the errors disappear in the editor,…
-
How to fix CAB to support dependencies across class hierarchy
The Composite UI Application Block’s Object Builder doesn’t support dependencies for same-named properties at different levels in the class hierarchy. If you add a dependency property which has the same name as a property in a base or derived class, only one of them will be initialized. The reason for this is probably that the…