March 25, 2011 14:16
After migrating from VS2008 to VS2010, I suddenly realized that I cannot debug my CLR stored procs anymore.
Solution, as we all know, is to start sql server in CLR2.0. To that end, we should add a file sqlservr.exe.config next to sqlserve.exe, with content
<?xml version ="1.0"?>
<supportedRuntime version="v2.0.50727" />
but not only that- for some reason, the first attempt to attach to Sql Server process still doesn't work. But if you try second time, it's all ok. Magic. (More on that here: http://www.sqlskills.com/BLOGS/BOBB/post/SQLCLR-debugging-and-VS-2010-revisited.aspx)
February 18, 2011 10:18
I have to break up my silence to send a beam of hate to software terrorists at RedGate management, who recently decided to charge for Reflector, an amazing tool they took over from Lutz Roeder in August 2008. Despite the original promises to keep the app free, Reflector7 is a paid only application and - lo and behold - the previous versions will cease to work from the end of February 2011.
What a damn shame.
May 23, 2010 19:56
Unit tests are not so different from other parts of the code.
You write a test once but expect people to read it many times. And you know what? There are only few reasons for revisiting a test:
- it started to fail
- it needs a refactor
- you want to learn the system under test.
Readability is the
key in all cases.
And - golly! - I came across a free tool which helps writing readable and maintainable tests. Test Lint is the name. This post is a quick sum-up of a quick evaluation I did the other day.
Here's a small VS2010 project (only VS2010 is supported) which shows some warnings and displays how to write a custom rule.
April 18, 2010 20:44
Building a project from command line gives you more control over the build process and provides quite a few other interesting options - comparing to building from Visual Studio.
And recently your humble correspondent was thinking about a "perfect build script" for an ASP.NET MVC project.
What should it have? Here's my take:
- Option to pre-compile views. Errors in views are not detected until run time but MvcBuildViews property is your compile time friend (pre-compiling the views is not
fast, so it's switched off by default).
- Option to run a clean build. Cached dlls are lurking around every bend so there must be a way to clean up everything.
- Non-removable unit tests runner. Even if running all your unit tests takes ages, there must be a set of "smoke" unit tests that verify your basics.
April 4, 2010 21:59
Here's a recursive Knetlik Law: post-processing of conference materials takes more time than one might have expected even considering the Knetlik Law.
Anyhow, the videos we were recording at Knetlik are finally online - courtesy of Andrew Kovalevsky.
You can find them on the website next to each speaker, along with the demo projects available for download. Enjoy!
March 14, 2010 21:45
Recently I was playing with ASP.NET MVC2 trying to find a neat solution for sending emails. This post is a sum-up of that little endeavour.
From it you will learn
- How to send HTML emails with MVCContrib and its EmailTemplateService
- How to test email sender without SMTP server
- How to use Ninject with MVC controllers
All those impatient readers out there, go ahead and download the source code of a small app that will be crafted in the rest of this post (zip comes along with MVCContrib source code, for some rich debugging experience).
February 21, 2010 23:58
We've got some very positive feedback about Knetlik conference that was held last week in Microsoft premises here in Prague. Thanks everyone who attended and presented - it was truly awesome!
And many people are asking for more. No problem, keep tabs on announcements, I guess we can make it at least bi-annual :)
Here go few posts about the event
February 7, 2010 19:43
There are tons of good papers and a bunch of questions on StackOverflow about designing and developing for security, but all of them seem to concentrate on what you should do.
However, recently I was after something different: a "visit a page, try this and that" kind of things, you know. A list of simple actions one should to go through once development is done, to make sure the solution is secure.
Here's something I've come up with so far:
January 31, 2010 20:03
I've been evangelizing the .NET platform for over 2 years, occasionally speaking (and listening) at venues from small local events to ponderously named conferences.
And let me tell you something: long presentations are not worth the time.
January 17, 2010 22:34
In the previous post your humble correspondent introduced Riant plugin which allows you to specify restricted internal access for types and methods. (You say "method Foo should be accessible only within My.Name.Space" - and lo and behold, R# screams bloody murder if Foo is called outside that namespace.)
This post will shed some light on how to write such a plugin. Take it with a fine grain of salt - I'm not working for JetBrains and everything I know comes from Resharper community, other open source plugins, and protracted hours with Reflector.