Tuesday, January 19, 2010

I ran into this problem this morning. When opening a solution within Visual Studio the application would process each of the projects and then exit abruptly. The application simply closed without any error dialog or feedback as to any problem that had occurred.

I checked the event log and found the following .NET runtime error in the application log:
.NET Runtime version 2.0.50727.3603 - Fatal Execution Engine Error (7A036050) (80131506)

Fortunately a quick search on google led me to this page:
http://michaelsync.net/2009/10/31/net-runtime-version-2-0-50727-3603-fatal-execution-engine-error-7a036050-80131506-mscoree-dll.

Thank you to Michael Sync for the helpful and detailed walkthrough.

I installed the updates from the Microsoft site as recommended and everything now seems to be working just fine.

If you like the content of this post or any other posts on this website, consider following me at www.stuartthompson.net.

Monday, August 31, 2009

Indeed it has been known for many centuries that the written word could depose rulers more swiftly than any sword.

"The indispensable catalyst is the word, the explanatory idea. More than petards or stilettos, therefore, words - uncontrolled words, circulating freely, underground, rebelliously, not gotten up in dress uniforms, uncertified - frighten tyrants." -- Ryszard Kapuscinski, Shah of Shahs

In the modern world however the typed word and even the encoded word has become the more powerful entity. Newspapers yield their control of popular media to an internet of blogs and the world finds itself more dependent upon technology than ever before. It is the era of the angle bracket, of the line of code, of the operating systems that provide our access to so many fundamentals. Within that system, underlying the facade of screensavers, services, and rounded icons dwells a dormant power that is understood and controlled by few. The age of software has come and all shall tremble before its power and majesty.

Thursday, August 27, 2009

It's a tricky problem and one that I'm currently researching. I began with an investigation into MathML, which I have written up here: http://devblog.stuartthompson.net/2009/08/mathnotationontheweb/

Monday, June 08, 2009

Software is broken, from the first version
Fowler has spoken, his gospel word.
Praise for the patterns, praise for MVP
Praise for our passive view of our world.

Hear there's a new thought, coming from Redmond
Wait it's an old thought we already had.
Praise for MVC, in its new format
Sprung in completeness where their feet pass.

Mine is a castle, and it's named Windsor
Born not from one light, silver or gray.
Praise it with caution, praise it with warning
MS' recreation of the new way.

(C) MVVMVPVC

Tuesday, May 26, 2009

Just in case this is useful to anyone else who needs a SQL table populated with the 50 U.S. states plus D.C.
insert [State] ([Abbreviation], [Name])
select    'AL', 'Alabama'
union
select    'AK', 'Alaska'
union
select    'AZ', 'Arizona'
union
select    'AR', 'Arkansas'
union
select    'CA', 'California'
union
select    'CO', 'Colorado'
union
select    'CT', 'Connecticut'
union
select    'DE', 'Delaware'
union
select    'DC', 'District of Columbia'
union
select    'FL', 'Florida'
union
select    'GA', 'Georgia'
union
select    'HI', 'Hawaii'
union
select    'ID', 'Idaho'
union
select    'IL', 'Illinois'
union
select    'IN', 'Indiana'
union
select    'IA', 'Iowa'
union
select    'KS', 'Kansas'
union
select    'KY', 'Kentucky'
union
select    'LA', 'Louisiana'
union
select    'ME', 'Maine'
union
select    'MD', 'Maryland'
union
select    'MA', 'Massachusetts'
union
select    'MI', 'Michigan'
union
select    'MN', 'Minnesota'
union
select    'MS', 'Mississippi'
union
select    'MO', 'Missouri'
union
select    'MT', 'Montana'
union
select    'NE', 'Nebraska'
union
select    'NV', 'Nevada'
union
select    'NH', 'New Hampshire'
union
select    'NJ', 'New Jersey'
union
select    'NM', 'New Mexico'
union
select    'NY', 'New York'
union
select    'NC', 'North Carolina'
union
select    'ND', 'North Dakota'
union
select    'OH', 'Ohio'
union
select    'OK', 'Oklahoma'
union
select    'OR', 'Oregon'
union
select    'PA', 'Pennsylvania'
union
select    'RI', 'Rhode Island'
union
select    'SC', 'South Carolina'
union
select    'SD', 'South Dakota'
union
select    'TN', 'Tennessee'
union
select    'TX', 'Texas'
union
select    'UT', 'Utah'
union
select    'VT', 'Vermont'
union
select    'VA', 'Virginia'
union
select    'WA', 'Washington'
union
select    'WV', 'West Virginia'
union
select    'WI', 'Wisconsin'
union
select    'WY', 'Wyoming'

Tuesday, May 19, 2009

Somewhere in Redmond, someone wasn't busy for far too long:
http://www.microsoft.com/click/serverquest/

This is a heck of a demonstration of just what Silverlight can do though.  Very, very impressive!

To learn how to create cutting edge Silverlight applications, sign up for one of our one-day technical courses at
http://events.sftsrc.com/

Wednesday, May 13, 2009

"If at first you don't succeed..."

Apparently the cool new conclusion to this motto is "throw your hands in the air and panic".  This is certainly how the SQL 2008 Management Studio reacts when it encounters a problem enumerating object explorer information for one or more databases on a server.  I recently installed the SQL 2008 tools and was quite surprised to encounter an error dialog following my first actions.  I connected to a server that contains several databases, only a few of which I have rights to access.  Upon expanding the Databases node in the Object Explorer window, I received the following error:



Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

Additional information:
An exception occured while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.ConnectionInfo)
The server principal "MyServerPrincipal" is not able to access the database "FirstDBInList" under the current security context. (Microsoft SQL Server, Error: 916)

Yikes!  I know that I don't have access to FirstDBInList but I'm unsure as to why that would stop me from enumerating the databases on the server.  Typically I'm allowed to at least see the list so that I can interact with my database via that window.  I am unable to perform any operations on the databases to which I don't have rights but that shouldn't stop me from interacting with the databases for which I have been granted permissions.

What's the problem?
Then a little bell rung in my head.  I'd seen this before.  I remember this from the SQL 2000 days.  A little googling turned up this great article by Aaron Bertrand.  It turns out that the Object Explorer Details window is part of the problem.  Whereas the Object Explorer window only shows the familiar list of nodes, the Object Explorer Details window attempts to go one step further and show additional information about each database.  However, in order to show that information the studio attempts to connect to each of the databases in the list.  If the current user does not have rights to one or more of those databases and they are configured to auto-close (as many are in many environments) then studio will panic after it is unable to retrieve the information it requested.  Instead of degrading gracefully and graying out the node or simply moving onto the next database in the list, it simply halts all operations and throws up the error dialog seen above.  Not very shiny!  Remember too that this is the SQL 2008 Management Studio in its default configuration.  Not exactly an edge case.

How do I fix it?
In order to fix the issue we simply need to tell studio to not query the databases for information it won't be able to retrieve.  It turns out that the offender in this case is "Collation", or rather that studio is unable to determine the state of collation on databases to which appropriate rights have not been granted.  The following steps can be used to achieve this.

First, open the Object Explorer Details pane either by clicking View->Object Explorer Details or by pressing F7.  Then double click Databases in the right-hand pane.  Finally right-click the bar showing the column headers and uncheck Collation.  You can now close the Object Explorer Details pane, right-click Databases in the regular Object Explorer pane and select Refresh.  The node should now expand as expected.





Why did that work?
This solution works for the following reasons.  The Object Explorer Details (OED) pane is used to show additional information about entities on a server.  The column headers in the Databases view of OED each show a particular piece of information for each database on the server.  When the Databases node in the regular Object Explorer pane is expanded, the management studio attempts to query for the information for each of these selected column headers just in case the OED pane will be shown.  However, if the current user does not have rights to query for that information on one of the databases then an error is thrown and processing stops.  This has the unfortunate side-effect of also stopping the enumeration of the databases in the regular Object Explorer window.  By removing the Collation column from the OED view, we effectively removed the check for collation settings when enumerating the list of databases.  The other default columns all represent data that can be queried even on databases for which the current user does not have rights.  However, if you find that the error resurfaces, try removing all of the other column headers from this view.

What can we learn from this?
This illustrates a larger programming principal, one that is often ignored to the detrement of many software packages; error handling and graceful degradation.

It is great that enumerating the data for the Object Explorer window also queries for information that the OED window might need.  However, it is not so great that a failure in the additional "helpful" task causes the originally requested operation to fail.  As a user the first assumption when encountering an error is that the current action being performed is responsible, not that some helpful side task was the culprit.  If helpful additional tasks are going to be performed, then wrap them in a layer of safety, have them handle their errors completely and get out of the way of the main task if they encounter a problem.

The second principal here is that of graceful degradation.  Often programs will show an error dialog or even quit completely when they run into a problem.  However, in many cases there is no need for such an abrupt halt.  The areas of the application that were of importance to the user might be completely unaffected by the problem that occured.  In the case of this management studio problem the user could have continued working quite happily without knowing whether collation was enabled for databases that they don't even have access rights to.

Conclusion
Throwing an exception and halting all processing in this case is a bit like taking the football home from the park just because you fell and scraped your knee.  It didn't make you many friends as a young MS-DOS program and it won't as an adult enterprise management application either.  Play nice...try, catch, and throw like the rest of the kids and leave the drama at home.

Friday, May 08, 2009

When is % not equal to %?  When you're using the LIKE statement in SQL Server Reporting Services.  If you've used the LIKE statement but haven't felt the love, it's because the standard wild-card operator (%) for a LIKE statement isn't the same in SSRS.  Instead of the  % operator they use *.

So the statement:
 WHERE Customer.Email LIKE '%' + @qEmail + '%'
should instead be:
 WHERE Customer.Email LIKE '*' + @qEmail + '*'

Tuesday, April 14, 2009

Spring is here and we're now offering a new set of courses for the coming months.  Be sure to check out the details below and reserve your seat now.  You can keep up to date with the latest course offerings at http://events.sftsrc.com.

April 22nd - 24th:  Silverlight for the Web Developer
Microsoft Silverlight is a cross-browser and cross-platform web-centric programming API which allows you to integrate extremely rich UI islands into a standard web application. Using Silverlight, developers can inject multimedia (video, audio, etc), user interactivity (games, gadgets) and other visual enhancements into their designs. This course examines the role of the Silverlight SDK and the numerous surrounding technologies (JavaScript, ASP.NET, XAML) and development tools (Microsoft Blend, Visual Studio 2005/2008 templates) used to build Silverlight-enabled web content.

May 11th - 13th: Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF) is an API used to build distributed applications using .NET 3.0 and higher. WCF was designed to expose the current multitude of Windows remoting APIs (web services, MSMQ, TCP, peer-to-peer, etc) from a single unified toolkit. In this course, attendees will examine the overall WCF programming model, binding choices, host options, security issues and the use of declarative markup to specify the underlying infrastructure.

May 26th - 27th: LINQ
You will learn to use the new .NET Framework 3.5 feature, Language Integrated Query (LINQ) to easily create complex data-independent queries. In addition, you’ll learn about the new language features added to Visual C# in Visual Studio 2008 in order to make LINQ possible. You’ll start by working through a quick overview of LINQ, and how it applies to working with collections of objects, retrieving data stored in SQL Server, and creating XML content. Subsequent topics introduce new LINQ-oriented language features, LINQ to Objects, LINQ to DataSets, LINQ to SQL, LINQ to XML, and LINQ to Entities. By the time you’ve completed the course, you’ll have a good understanding of how to construct LINQ queries to work with data and how Visual Studio 2008 supports LINQ.

May 28th: Agile in a day
While more and more companies are practicing “Agile” software development, there is still a great deal of misunderstanding and confusion that surrounds the term.  This one day lecture class will cover the basics of Agile development using Scrum, including

* Product, release and sprint planning
* The product backlog
* The roles of the Scrum master and product owner
* The importance of demos
* What it means to be done with a task in Scrum

The instructor has participated in numerous Agile projects in a wide variety of organizations, and will include a discussion on common pitfalls and barriers to Agile adoption as well.

May 29th: Hands-on Continuous Integration with Free Tools
This one day course will provide a hands on look at setting up a Continuous Integration process using freely available tools from beginning to end. Students will learn the theory and practice behind establishing a Continuous Integration process, including setting up a build script, running unit tests, setting up an automated build/test server, and capturing reporting information for the whole process.

Wednesday, April 08, 2009

It's been several years since I did any games programming.  I have always maintained an avid interest in 3d modelling and graphics programming and love the world of video games and video game development, however I have found it hard to set aside the time necessary to really dig into the field further.  I've been unwilling to consider becoming a professional games developer because the reality is that all but a select few earn the kind of money that is available in commercial software development.  As the head of household and provider for our family I can't justify cutting my salary in half (or more) to work insane hours in one of the most demanding corners of our industry.

However, the draw of games development and more specifically of DirectX development has sucked me in once more.  I'm enamored by the idea of being able to create 3d models and render them inside a game engine.  It's not even about an interest in commercial exploitation or of using a game framework to create the next big hit, I'm just fascinated by the science and technology of 3dmodeling, rendering, shading, lighting, and voodoo.

So, dear friends, I am going to do my best to document my journeys through the jungle of DirectX development.  Primarily my goals from this are to create a basic DirectX 10 application, capable of rendering .x models created in TrueSpace 7.6 and develop an understanding for how graphics devices and model rendering in DX10 works.  I understand the basic principles and a lot of the underlying math, but the technology of rendering has moved on so much since I was last involved (DirectX 6).  This project will hopefully provide a nice refresher on C++ as well as give me a deeper understanding on where 3d graphics technology stands today.  Who knows, perhaps this little venture will produce something I can share. :)