Showing posts with label .NET General. Show all posts
Showing posts with label .NET General. Show all posts

Wednesday, April 6, 2016

Connecting SQL Server Management Studio and SQL Server Profiler to LocalDB

I find the Visual Studio 2015 SQL Server Object Explorer to be quite slow. Also, as anybody working with an ORM, I want to monitor the SQL-commands being fired against the database during development to make sure I didn't screw up too much. 

Wouldn't it be nice to use good ol' SQL Server Management Studio and the SQL Server Profiler for that? I think so, but the Internet says NO! I've accepted that as a truth for some time, but yesterday I decided to revisit the topic, and actually found out that it works just fine.

Now I can enjoy both the speed of SSMS and the power of the Profiler without replacing LocalDB. 


  1. Install SQL Server Management Studio, mr Hanselman has created a nice download overview here:
    http://www.hanselman.com/blog/DownloadSQLServerExpress.aspx
  2.  Open a Command Prompt and run this command
  3. Now find the instance pipe name for the instance you want to connect to
  4. Use the instance pipe name as server name in the connect dialog for SSMS, and you're ready to rumble.


Wednesday, October 10, 2012

Great articles

Here's a bunch of great articles/blog posts too well written to forget about.
  • Scott Allen: A Software Developer's Guide to HTTP (5 parts all together)
    Important to understand in these RESTful days...
    Very well written an informative. If you've been into web development for some time you're probably already aware of these concepts, but still I'm sure you'll discover a few gems reading it.  

Thursday, August 12, 2010

Sandcastle

Here’s another brain dump on how to get started with Sandcastle.

  1. Install the latest release of Sandcastle (currently the June 2010 release) from
    http://sandcastle.codeplex.com/
  2. Install the latest release of Sandcastle Help File Builder (currently the Jul 2010 release) from
    http://shfb.codeplex.com/
  3. Make sure your Visual Studio projects that contains the things you want to document has the XML documentation file checkbox enabled under Project properties->Build->Output->XML documentation file.
  4. Create a new SHFB-project and add the assemblies you want to create documentation for as ‘Documentation Sources’. 
    image
    I tried adding the .proj file for the project (*.Service.Contracts) holding references to two other projects (*.Service.Messages and *.Entities), but then the generated documentation were missing information on the types defined in the referenced projects. 
  5. Set the project properties you find relevant. The SHFB supports the standard Sandcastle styles (Hana, VS2005 and Prototype).
    I personally prefer the Hana-style.
    image
  6. Documentation can be created either by using the SHFB GUI (Documentation->Build project) or via MSBuild.
    Currently SHFB creates a .build file targeting MSBuild 3.5, so if you run the .build file through MSBuild 4.0 you will get a warning saying:

    SHFB : warning BHT0001: Unable to get executing project: Unable to obtain int
    ernal reference.  The specified project will be loaded but command line propert
    y overrides will be ignored

  7. Fair enough if you stick with keeping configuration inside .build file and avoid command line properties.
    Until SHFB supports MSBuild 4.0 there are workarounds, see the comments in this thread for inspiration:
    http://shfb.codeplex.com/Thread/View.aspx?ThreadId=50652

NOTE 1: If you get an error when using MSBuild saying that the SandcastleHelpFileBuilder.targets file can’t be found, add an environment variable named SHFBROOT and set the value to c:\[path to your SHFB installationfolder], eg.: C:\Program Files (x86)\Sandcastle Help File Builder

NOTE 2: Seems like DocProject is working on adding support for the latest Sandcastle/VS release. Might be an alternative to SHFB once it’s been released.

Tuesday, March 30, 2010

Extracting an assembly from the GAC...

...can easily be done without the need of a third party tool.

Here's how:
  1. Open the Windows Explorer and map a new network drive.
  2. Map to the GAC folder on you machine, e.g.: \\YOURMACHINE\c$\windows\assembly
Voila - that's it.
You can now open the newly added network drive and copy out the assemblies from the GAC.

Wednesday, March 17, 2010

Determine if an assembly is compiled for 32-bit or 64-bit

I would have expected Reflector to be able to tell me, but it seems it can't.

So here is how:
http://stackoverflow.com/questions/270531/how-to-determine-if-a-net-assembly-was-built-for-x86-or-x64

I will copy the information here for easy access:
  1. Open the Visual Studio Command Prompt (In Windows: menu Start/Programs/Microsoft Visual Studio/Visual Studio Tools/Visual Studio 2008 Command Prompt)

  2. CD to the directory containing the DLL in question

  3. Run corflags like this: corflags MyAssembly.dll

You will get output something like this:

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  3.5.21022.8
Copyright (c) Microsoft Corporation. All rights reserved.

Version : v2.0.50727
CLR
Header: 2.5
PE
: PE32
CorFlags : 3
ILONLY
: 1
32BIT : 1
Signed : 0

The key is the "32BIT" flag as documented above: 1 = x86; 0 = Any CPU.