Crystal Reports 13 Maximum Report Processing Limit Reached Workaround

In the Visual Studio 2012 version of Crystal Reports 13 there is a threshold that throttles concurrent reports, this also includes subreports, to 75 reports across a machine. This means if there are 5 web applications on a given server all opened reports across all 5 web applications counts toward the 75 report limit. The…

Considerations When Throwing Exceptions

A co-worker sent an email with some code he’s struggling with. He’s trying to avoid using try/catches to drive business logic. The problem is not the try/catches it’s simply a symptom of the problem. Can you spot the problem? You’ll have to make some assumption, but I have faith you’ll come to the same conclusion…

Setting up Single Sign On with Windows 2012 and ASP.Net MVC 4

Requirements Windows 2012 AD FS 2.0 Feature installed ASP.Net MVC 4.0 Valid SSL certs Visual Studio 2012 This document covers setting up an ASP.NET MVC 4.0 application using Visual Studio 2012, Windows 2012 and AD FS 2.0 to enable Web Single Sign On. It’s important to have valid SSL certificates. Self signed certificates will not…

Creating a Generic Type at Runtime

I have a type (at runtime), I want to use it with an IOC container (in this case StructureMap) to find a generic implementation using this type. How do I do that? It’s simpler than you’d think: Type genericType = typeof (AbstractValidator); Type type = genericType.MakeGenericType(bindingContext.ModelType); //Structure Map container var instance = _container.GetInstance(type);

Deploying with MsDeploy Outside of Visual Studio

Building the msdeploy package with MSBuild. This requires MsDeploy to be installed on the build machine. MSBUILD /T:Package /P:Configuration=QA;PackageLocation=”C:\Build\Artifacts\eserve\DEV\QA\QA.zip” Deploying the package with MsDeploy to a web site How to get the msdeploy command. -source:package=’C:BuildArtifactseserveDEVQAQA.zip’ -dest:auto,ComputerName=’https://eserve-dev.sacda.org:8172/MsDeploy.axd?site=eserve-dev’,UserName=’conwayc’,Password=’austin_1′,IncludeAcls=’False’,AuthType=’Basic’ -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -allowUntrusted -retryAttempts=2 Copying the package with ROBOCOPY Copying the package to another folder with robocopy…

Code Refactor

On a recent project, I was tasked with refactoring large parts of a web system. It’s written in C#. Over time some of the code-behind files had grown to 4000 lines. The goal was to get this number down to a more maintainable level. Over the next few posts, I’ve taken snippets of code that…

Weighted Random Distribution

This is genius; I could have used this a couple of years ago. I’m posting it here for safe keeping. Note that I am NOT using the random class. The random class is not truly random. It’s based on time. Time is predictable. RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] result = new byte[8]; rng.GetBytes(result); double…