Skip to main content

Posts

Showing posts from January, 2011

Accessing GAC DLL's in Visual Studio 2010 "Find References"

Or better titled I've just registered my DLL in the GAC, why does it not appear in Visual Studio's "Find Reference" dialog.It's probably the first thing people notice after they've started using the GAC for the first time. You've managed to register your DLL and you've confirmed it is in the GAC, but it just won't appear in Visual Studio's "Add Reference" dialog box.   As it turns out, for what were probably good reasons, the visual studio team decided to use the registery to hold the list of DLLs that appear in the "Add Reference" dialog box.You have two options, the first is to manually edit the registry - adding your DLL to the following registery keys:[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\AssemblyFolders][HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\AssemblyFolders]Another option is to install the Visual Studio extension MUSE.VSExtensions, which adds an extra option to the co…

Adding a DLL to the GAC in .NET 4.0

GACUTIL.EXE is no longer supplied / installed along with Visual Studio, instead it has been moved into the Windows SDK v7.1.   So to install a DLL into the GAC for .NET 4.0 (or anything after v1.1 I believe) you must first download and install the SDK.  Once you have done this you must locate the relevant version of GACUTIL from the four possible locations:Program Files\Microsoft SDKs\Windows\v7.1\Bin\Program Files\Microsoft SDKs\Windows\v7.1\Bin\x64Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 ToolsProgram Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\x64 The first two are for registering DLLs to be used in .NET 3.5 or earlier, with the first being for x86 and the second for x64 versions.The second two are for registering DLLs to be used in .NET 4.0, again with the first being for x86 and the second for x64 versions.With the release of .NET 4.0 the framework now has two GACs, this stackoverflow post explains why.

Javascript: Type and Value Comparison

A common problem when doing value comparison inside of Javascript is the automatic type conversion that happens for you, this means all the following statements resolve to "true".1 == 1;1 == '1';1 == "1";As a little bonus snippet in a post by Steve Wellens he provides an answer to the problem, the triple equals ("===") and it's corresponding not equal ("!==").  These comparison operators perform a type check as well as a value check.  This means that a string value will nolonger equal it's corresponding numeric value as the type check will return false.  A useful bit of functionality to have.

SQL Server Licensing

As part of my current project I’ve spent some time over the past couple of months trying to determine the best (cheapest) SQL Server configuration to support web servers running in a virtualised environment. As a quick disclaimer, the following are my thoughts on the subject and should be used as guidance for further research only!Firstly you need to figure out whether you are going to license using the “per user” or “per processor” model. For most typical configurations a “break even” point can be determined when it becomes cheaper to switch to the per processor licensing model instead of the per user model. It is important however to plan for future growth as it can be very expensive to try and switch from one model to another once a system has been deployed. It is not possible to convert SQL “user” CALs into a processor license.If you are developing a web application that will be exposed via the internet to external customers then it would probably make sense to use the web edition…

Resolving the HTTP/HTTPS “Document contains both secure/unsecure content” message

One of the most commonly encountered issues when developing websites that must support both HTTP and HTTPS pages is the warning that a secure page “contains both secure and unsecure content”. In a nutshell this is when a page that is being displayed via the HTTPS protocol contains one or more references to additional resources (JS/CSS/Images) using just HTTP.The solution is easy and well documented for locally referenced resources, in that when making the reference to the required file you exclude the protocol and domain name ending up with something like “/styles/main.css”, which will quite happily call “main.css” from a “styles” folder in the root of the web application regardless of whether the containing page is being called by HTTP or HTTPS.Note: .NET provides functionality such as ResolveUrl(“~/styles/main.css”) which should always be used in preference to hard coded paths such as “/styles/main.css”. Using ResolveUrl(…) will work regardless whether in IIS the web application has…