OCIEnvNlsCreate failed with return code -1

"OCIEnvNlsCreate failed with return code -1 but error message text was not available". This was the error that was really anoying my last week. I've had this problem before on one of our servers and this time it showed up in one of my co-workers machine.

Once again Sysinternals came to the rescue. When I used ProcessMonitor to watch the application running I noticed that it couldn't load some of Oracles dlls. The really strange part was that the dlls it was complaining about were from Oracle 10 and the client we were using were from version 11. I then decide to use ProcessExplorer to checkout out application process in order to find out what dlls were really loaded. Imagine my surprise when I saw that the application had the oci.dll from version oracle client 10 running. At some point someone had put a copy of this dll on the windows/system32 folder, and that was the dll that was being loaded instead of the correct one that was in the Oracle install directory.

After we deleted the incorrect dll our program still had the same error. Turns out that the ORACLE_HOME environment variable was not set either. Once we set the variable and restared IIS it was all fine! So, to sum up:


OCIEnvNlsCreate failed with return code -1 but error message text was not available


 1 - Check if the ORACLE_HOME environment variable is set correctly. Here is how to do it.

 2 - Use Process Explorer to check out what versions of Oracle's dlls are loaded. If it's a different version from the version of the client you have installed, remove these incorrect versions from your machine. They may have been there from a previous client installation.

I hope this will help someone else!

How to Download NDC 2009 Videos

The NDC (Norwegian Developers Conference) 2009 had a lot of interesting talks which I was really looking forward to watch. The links I found in the net weren't right and I wasn't able to watch any of the videos. After snopping around for a while I bumped into a tweet from Scott Hanselman saying that the videos were there but they had  problem in the url. After been able to see the viedeos I used I sniffer to get the real url. The links were pretty close to the addresses I saw in the MSDN Up North blog post. The difference is that in this post the urls were: www.smartcom.no/download/video_file.wmv and the actual address is od01.smartcom.no/ndc/video_file.wmv.

The videos are still streams but if you want you can use RealPlayer to save the ones you want.

To make it easier for everyone here are the correct links (I corrected the links from the MSDN Up North blog post):

Ayende Rahien
Building Scalable Systems
Inversion of Control & Dependency Injection: Breaking out from the Dependency Hell
Object Relational Mapping + = 2: More than just Data <--> Object
Producing Production Quality Software
Writing Domain Specific Languages in Boo 
Craig Larman
Agile Architecting 
The "Toyota Way House" for Large-Scale Lean Development 
Ian Griffiths
Writing Custom Windows Presentation Foundation Pixel Shader Effects 
Jeremy D. Miller
Convention over Configuration applied to .NET 
Lessons Learned from a Long Lived Codebase 
Presentation Patterns for Composite Applications
Software Design and Testability 
Jimmy Nilsson
Is Domain-Driven Design more than Entities and Repositories? 
Jonas Follesø
Building Business Applications in Silverlight 3 
MVVM Patterns for Silverlight and WPF applications 
MVVM Patterns for Silverlight and WPF applications 
Kevlin Henney
A Decent Proposal
Lean Code
Slicing Design over Time
Modelling in the Age of Agility 
Sustainable Software Architecture
The Uncertainty Principle
Michael Feathers
Design Sense Deep Lessons in Software Design 
Functional Thinking for Object-Oriented Designers 
Seven Blind Alleys in Software Design 
Working Effectively with the Legacy Code: Taming the Wild Code Base 
Michele Bustamante
A Lap Around Geneva Framework 
Access Control Service: Federated Security in the Cloud 
Building a Windows Communication Foundation Router - Today and Tomorrow 
Windows Azure - Your Operating System in the Cloud 
Mike Cohn
Agile Estimating 
Agile Planning 
Getting Agile with Scrum 
Leading a Self-Organizing Team 
Prioritizing Your Product Backlog 
User Stories 
Peter Provost
Code First Analysis and Design with Visual Studio Team System 2010 Arch Ed 
Extending VSTS 2010 Architect Edition 
The Butterfly Effect 
Phil Haack
ASP.NET MVC + AJAX = meant for each other
Black Belt Ninja Tips ASP.NET MVC 
Phil Haack & Scott Hanselman The Haacked and Hanselman Show 
Rafal Lukawiecki
Architectual use of Business Intelligence in Application Design 
Automatic Recommendation Engine Based on Data Mining 
Finding Hidden Intelligence with Predictive Analytics of Data Mining 
Microsoft Solutions Framework 4.0 Core for Solution Delivery Projects 
Richard Campbell
Richard Campbell & Carl Franklin .NET Rocks! Live 
The Scaling IQ Test: When Development and IT Pros Collide 
Robert C. Martin
Clean Code: Functions 
Clean Design: Components Principles 
Clean Design: SOLID Principles I and II 
Clean Practice: Agility and Craftsmanship 
Roy Osherove
Unit Testing in Silverlight
Test Driven Development: Using Mock Objects 
Understanding Test Driven Development
Unit Testing Best Practices
Scott Hanselman
Deep Tour of .NET 4
Making Your Blog Suck Less: Social Networking and Your Personal Brand Online 
The magic of 'Astoria' - ADO.NET Data Services 
Ted Neward
Core Windows Communication Foundation Patterns 
Rethinking "Enterprise" 
Ted Neward The Busy Developer's Guide to ECMA(Java)Script 
Why the Next Five Years Will Be About Languages 
XML Messaging in .NET using Windows Communication Foundation 
Tim Huckaby
Building Data Visualization Applications with the Windows Presentation Foundation
Integrating Windows Presentation Foundation and Windows Communications Foundation into Your Office Business Applications 
Jump into Windows Presentation Foundation! ...and Become Immediately Effective 
Udi Dahan
Asynchronous Systems Architecture for the Web 
Avoid Failed SOA-business & Autonomous Components to the Rescue 
Intentions and Interfaces - Making Patterns Complete 
Reliability, Availability, and Scalability - How to have your cake, and eat it too 

Hope this will help.