.NET

Need to Repair COM+ to get .NET working again?

January 28 2010

Trying to be a “Good Windows User”, I installed the last few Windows system updates. Unfortunately, I also need to be a “Good .Net Programmer”, and one of the recent security updates made it so that my local machine could not serve up ASP.NET pages anymore. I could surf to HTML pages on “localhost”, but trying to load up any of my local ASP.NET pages caused the WWW Publishing service to stop. The culprit was a conflict with COM+. I tracked it down to an error in the Application Event Log with the following message :

“The run-time environment has detected an inconsistency in its internal state. This indicates a potential instability in the process that could be caused by the custom components running in the COM+ application, the components they make use of, or other factors. Error in f:\xpsp3\com\com1x\src\comsvcs\package\cpackage.cpp(1184), hr = 80070002: InitEventCollector failed”

After trying a few solutions that didn’t work, I found out about the Windows update problem, and an approach to fix it here :
http://support.microsoft.com/kb/315296

I was able to repair my COM+ install using the method from that page. My machine is now telling me (again) that I have an important Windows system update to install, but I think I will hold off for a bit…I have actual work to do.

Comma Delimited List as Stored Procedure Parameter

May 22 2007

The crew at 4 Guys From Rolla have come through for me again (as they frequently do in matters of ASP, .NET and SQL). In building a new webservice, I wanted to be able to pass in a comma-delimited list of ID's to a SQL stored procedure. Unfortunately, there isn't a SQL datatype for something like "comma delimited list". I could have taken the "easy" way out and built the SQL query dynamically in C# instead of calling a stored procedure, but then I would have been mad at myself for breaking the rule that we agreed on that all the webservices would strictly call stored procedures. I figured I'd have to use SQL to parse a passed in string into ID's, and build the SQL query from there. However, this seemed like something someone else probably would have done in the past. I found a few techniques online but this one seemed the cleanest and best-implemented. You basically pass in a big varchar string of id's into the stored procedure and then call a SQL User Defined Function called "Split" which returns a table of the ID's which you can join to. It's simpler than it sounds...instead of having something like

SELECT *
FROM table
WHERE id in (--lots of convoluted code to parse out the ids--)

you just call

SELECT *
FROM table
WHERE id in ( SELECT convert(int,Value) FROM dbo.Split(@list_string,',') )

The complete code for the function and examples of how to use it are listed in the article. Thanks to "4 Guys" for saving me a couple hours and some headaches with this nifty technique!

Web Project vs Local Project

March 1 2007

Call me old school, but I like all my projects in Visual Studio .NET to be standard class library projects rather than "web" projects. I am sure the Web Projects wizard is very useful for creating quick applications, but as with any wizard, it decides some things for you during set-up that might be hard to edit later. So, what happens if you inherit a solution file that is a Web project, and you have no idea how the virtual directories and references are set up? Unfortunately, you cannot open this project in Visual Studio to edit those settings! What I forgot today was this : "The Project files is just a text file, that you can edit in notepad". Once I figured that out, I was able to change "ProjectType" attribute from "Web" to "Local". Magically, I could open the project, update my references and compile about 2 minutes later.

Flash Remoting (via .NET v1.1) with VS 2005

February 21 2007

Of course Visual Studio 2005 doesn't compile for .NET Framework v1.1. Of course you can't (easily) buy Visual Studio 2003 new. Who would want to do that? Well, me for one; at least until Adobe releases some Flash Remoting components for .NET v2.0.

In lieu of any built-in backwards compatibility support from Microsoft, there are a number of community solutions for Flash/Flex developers who through one circumstance or another are using VS2005 (or, of course, anybody else who wants to target v1.1 from VS2005). Microsoft has adopted MSBee as a VS Powertoy, so I guess that's as close to official as you're gonna get -- It's even got a fancy .msi installer. Jomo Fisher's blog entry explains what I suspect is going on under the hood of MSBee, and Gustavo Guerra created a build targets file that includes Mono and .NET Compact Frameworks, though it seems to be missing from Gustavo's link in that forum entry.

Of course, you could try to go the other way and fix Remoting instead of Visual Studio, which is what the developers of Flourine are trying to do with an Open Source (GNU Lesser GPL) Remoting library which supports both .NET v1.1 and v2.0. You have to build the gateway dll yourself, but once you do, you can use the wizard they provide for VS2003 or VS2005 to create and configure a project for your Remoting services.

read more...
Archives
January, 2010 (2)
November, 2009 (1)
October, 2009 (1)
January, 2009 (1)
October, 2008 (1)
July, 2008 (1)
May, 2008 (3)
April, 2008 (1)
March, 2008 (1)
February, 2008 (1)
January, 2008 (1)
November, 2007 (2)
October, 2007 (1)
September, 2007 (2)
August, 2007 (3)
July, 2007 (3)
June, 2007 (2)
May, 2007 (4)
April, 2007 (4)
March, 2007 (4)
Tags
.NET ASP award awards Banner blog Campaign CMS Design Development DryJoys Flash FootJoy Forms Hacks Information Architecture Information Archtecture Interaction Internationalization Launch logo design Microsite Microsoft MITX Nomenclature PhizzPop process qa Usability Web Standards
Contributors
Brandon (8)
Denis (4)
Denise (21)
Jon (12)