Jul 20 2010

Unity Injection With ASP.Net and WCF - Presentation deck and code

Category: .Net | IT RelatedRory Primrose @ 08:25

Yesterday I ran a couple of sessions at the Canberra .Net users group. I have attached a zip of the presentation deck and demo projects for you to have a look at in your own time.

Unity Injection With ASP.Net and WCF.zip (1.45 mb)

Tags: , , , ,

Jul 18 2010

Speaking at CodeCampOz

Category: IT Related | .Net | ApplicationsRory Primrose @ 04:19

Mitch has just posted the agenda for CodeCampOz that is running in November. Looks like it will be a really good mix of information being presented this year.

I’ll be running a session on Windows Identity Framework and how to use it without federation. Here is the abstract for my session.

Not a WIF of federation

The Windows Identify Framework (WIF) provides the latest Microsoft implementation for working in the claims-based identity space. WIF has particular strengths in providing federated security for systems that target users across multiple security domains, multiple credential types and multiple credential stores.

Unfortunately the available WIF documentation and samples almost completely deal with federated security scenarios. The information provided continues to use federated security architectures (Security Token Services, Issuing Authorities, Relying Parties etc.) even when federation is not used.

Developers of small systems may find it difficult to understand how WIF fits into their system designs. Small systems in this context tend to have their own security store, do not cross security domains and may not even run within an Active Directory managed domain.

There are clear benefits with using claims based security in both large and small systems. How do developers leverage claims-based security without being tied to federated security architectures?

This session will briefly cover the benefits of claims-based security and then look at how to implement WIF in ASP.Net and WCF applications without federation dependencies.

Tags: , , ,

May 20 2010

Richard is blogging

Category: IT RelatedRory Primrose @ 07:05

I’ve finally convinced a work colleague to start blogging is tech experiences. His first tech related post is Simple way to encrypt App.Config through WiX 3.5 and VS2010 Using C# code.

Tags: ,

Feb 17 2010

Recommended reading for developers

I was reminded this morning of an email that I sent to the junior developers on my team when they joined us. It is an overview of some of the development practices, patterns and products that they would get exposed to on our project. I have included it here as a reference collection for others.

Principles and Patterns

These are things that I often use and are still learning to use.

Jeremy Miller also writes a series called Patterns in Practice for MSDN Magazine (see list at http://msdn.microsoft.com/en-au/magazine/cc720886.aspx). They are all a good read, especially:

Tools

These are tools that are good to get experience using. Most of them relate to the patterns above. There are other tools used like ReSharper, dotTrace, StyleCop, WinMerge etc, but they don’t have the up skill requirement that the following tools do.

Probably the most important tool to start using is Rhino Mocks. The only way to get experience with it is to start writing unit tests in VS. See the documentation at http://ayende.com/wiki/Rhino+Mocks+Documentation.ashx.

Tags: , , , , , , , , , , , , , ,

Nov 18 2009

Is there a point to code coverage?

Category: IT RelatedRory Primrose @ 09:40

Code coverage is a concept that is often misunderstood and misused. It gets some criticism every once in a while because of this.

The most common misconception is that code coverage is a measure of code quality. The name code “coverage” also makes it easy to assume that it is a metric regarding the exhaustiveness of test effort. Neither of these are incorrect.

My definition is that code coverage is a measure of what you haven’t tested. Nothing more, nothing less.

Just because something is covered by a test does not ensure that the code is either of adequate quality nor that all possible scenarios are tested for that code. If it isn’t covered though then it isn’t tested and needs some attention.

Tags:

Apr 23 2009

Saying goodbye to friends (for now)

Category: IT RelatedRory Primrose @ 10:44

I’m saying goodbye to some friends for a couple of weeks as I head back into the land of documentation.

Tags:

Mar 30 2009

Going to CodeCampOz 2009

Category: IT RelatedRory Primrose @ 16:24

I'm really looking forward to Code Camp this weekend (nerd camp my mother-in-law calls it). It should be a great weekend of sessions and networking. Hopefully I'll get to catch up with friends and meet some great new people.

See you there!

Tags:

Mar 11 2009

Lightning fast Australian broadband

Category: .Net | IT Related | Software DesignRory Primrose @ 19:45

I've been on ADSL2+ for a few years now. Having a possible maximum speed of 24Gb is nice, but the actual floats between 5-7Gb being 3.5km from the exchange. That's not great, but is fast enough for general net usage. Tonight however, surfing the net has been slow. Really really slow. So slow in fact, that www.speedtest.net tells me this.

In the test before this one, the upload speed was actually a tad faster than the download speed. Did someone say broadband???

Yep, I'm glad that broadband in this country is so fast. My sarcasm drips all the way from this post to this article. Broadband in this country is a disgrace which is a real shame.

Update:

This morning is better :)

Tags:

Mar 11 2009

SCOM event collection fails with (0x8007000E)

Category: IT RelatedRory Primrose @ 08:59

I have written some custom SCOM management packs that read from a database and populate event collection data (see here and here for some examples from other people). My first management pack works without any problems. The second management pack (essentially a copy of the first) fails with an out of memory exception. The Operations Manager event log on the SCOM server contains an entry that starts with the following:

Converting data batch to XML failed with error "Not enough storage is available to complete this operation." (0x8007000E) in rule "[RuleName]"

This has been plaguing me for weeks but I now have an answer.

The definition of a collection event record includes a description field. The description field may be defined with a static value, a property bag (params) value or combination of both. The property bag value can be fully qualified (in the format of $Data/Property[@Name='<PropertyBagItemName>']$) or referenced by index. See here for more information.

My management pack originally contained the following:

<Description>%16</Description> 

In the case of my second management pack, the index is incorrect. There were field differences in the database output between the two management packs such that the param index was pointing to a different field from the database. I fixed this up so that it was pointing to a "Message" property bag value populated from the database.

<Description>$Data/Property[@Name='Message']$</Description> 

Now the management pack works. The difference between the two fields was that the original field (identified by index 16) had a null value whereas the "Message" field did have a value. My scripts deal with null values by ensuring they are always converted to empty strings using the following old VBA trick:

Call propertyBag.AddValue("Message", rs.Fields("Message").Value & "") 

After a bit of playing around, I found that there isn't a problem with the property bag containing empty values, but there does seem to be an issue with the event collection properties themselves having empty values when identified by index. If the fully qualified reference to the property bag item is used and it has an empty value, there is no problem.

Always make references using the fully qualified property bag reference in order to avoid this problem. This will also avoid problems should the structure of your property bag change.

Tags:

Feb 13 2009

SQLEXPRESS fails to start

Category: IT RelatedRory Primrose @ 04:33

I have just encountered a problem where the SQLEXPRESS instance installed on my machine was not starting. It looks like a recent windows update has failed, but also knocked out SQL Server. The event log contains the following entry:

Error 3(error not found) occurred while opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary.

After searching around, there seems to be lots of forum posts going back several years about this issue. The problem is that the only known solution seems to be to change the credentials of the SQLEXPRESS service account to Local System. This will then allow the service to start. Doing this through the services console presents a problem however because you can't set the service credentials back to Network Service as you need to know the password.

A better answer was found in this forum post. Using the SQL Server Configuration Manager, you can change between the system accounts without needing to know the password.

image

What you need to do is change the account to Local System, then click Apply and Start. You can then click Stop and change the account back to Network Service and then click Apply and Start again.

Tags: