robgruen's WebLog

my intelligence is artificial...

Browse by Tags

Tagged Content List
  • Blog Post: Getting a System.Runtime.InteropServices.COMException when trying to use BitmpaMetadata to extract EXIF/XMP data?

    Well if that's the case, it's probably cause you're attempting to use this class from a MTA thread. In order to fix this, just change the apartment of the thread where this code is running from MTA to STA (either using the [STAThread] Attribute or by setting the ApartmentState member of the thread that...
  • Blog Post: Referencing Sharepoint Assemblies on x64bit Installs causes build errors for ASP.NET apps (in VS.NET 2005)

    You may encounter the following error if you are trying to build a ASP.NET application or web service on a x64bit machine where Sharepoint is installed: Error 1 Could not load file or assembly 'Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one...
  • Blog Post: Ain't Programming Fun!

    So I was upgrading a project from VS.NET 2003 to VS.NET 2005 (v2.0 of the framework) and I kept hitting this assert: " _CrtIsValidHeapPointer(pUserData) . " There were several postings out and about but they were all for previous versions of the framework, nothing to do with upgrading to whidbey. After...
  • Blog Post: Getting VSIP to browse

    The VS.NET SDK (a.k.a. VSIP package) lacks the wide spread use and documentation that other SDKs enjoy. To make a change to that here's a little snippet that shows you how to open the VS.NET webbrowser and browse to a particular page: IVsWebBrowsingService web = ( IVsWebBrowsingService )Vsip.VsPackage...
  • Blog Post: ASP.NET 2.0 & "allowDefinition='MachineToApplication'" error message

    So, I upgraded an existing ASP.NET (1.1) application today to ASP.NET 2.0. The upgrade had some warnings which seemed unimportant but it didn't matter since I had elected that the upgrade wizard make a backup of my application. Alas when I try to run the application I ran into this problem : " It...
  • Blog Post: I took some notes on some remoting questions I recently answered...

    Server activated objects (SAOs both singleton and singlecall) use threadpool magic to execute remoting calls on thread pool threads. See ThreadPool.QueueUserWorkItem in the docs. Also note that you can change the # of thread pool threads…the default is 25 per proc. It is possible to share data...
  • Blog Post: The Case of the Mysterious Hanging Shell

    Please note that the identities mentioned in this story have been changed to protect the innocent. Any names that coincide with real life people is purely coincidental. So there I was, calmly working away when I get the phone call that started it all. I pick up the phone, “Hello?” I ask. ...
  • Blog Post: Caspol -s Behavioral changes for Whidbey

    We generally use "caspol.exe -s off" as a quick test to determine if .NET framework security plays a part in problems with managed components. It used to be that sometimes people would forget to run "caspol.exe -s on" to turn framework security on. Imagine all the nasties that could infect your box then...
  • Blog Post: Some KB articles don't like to be found

    For Instance: ActiveX control containers that support .NET controls - http://support.microsoft.com/?id=311334 I've known of the existince of Q311334 long before it was published. But to this day, I can never seem to find it when I need it. I have had to reference this KB article quite frequently ...
  • Blog Post: The evading solution to large remoting messages

    Thanks to rick for the title! We are seeing more and more people encountering: Q322975 BUG: Passing large quantities of data in .NET Remoting calls causes an unexpected exception to occur - http://support.microsoft.com/?id=322975 . As you can tell from the title of the KB article...
  • Blog Post: Read this if you're getting an InvalidCastException when referencing a type created with AppDomain.CreateInstanceFrom

    I was helping someone out with an issue the other day. Basically we were attempting to create an instance of an object within an AppDomain and then use that object. Unfortunately when casting the object from the object returned from CreateInstance to the desired type we were getting an InvalidCastException...
  • Blog Post: .NET’s Imaginary quest to rule the world: Whitelisting ala managed style.

    At some point, for some reason, maybe because of Episode III (or maybe not), you’re going to want to white list an application within the Windows XP SP2 Windows Firewall from managed code. You can do this easily enough from VBScript by using this handy VBS snippet . If you want to do this from managed...
  • Blog Post: Launching the Internet Properties dialog from C#

    If for some reason you need to show the Internet Properties dialog from your managed app you have two choices: 1. Launch the CPL file using the file association. The only caveat of doing this is that the dialog is modeless and will stay up even after your process dies. The way you would do this is: Process...
  • Blog Post: Helping the online community by closing the G ap

    I have had the great opportunity to help out a customer of ours named Mike. Mike was getting a “Class Not Registered” error when attempting to create an instance of a DCOM object using Type.GetTypeFromProgID() and Activator.CreateInstance(). Things worked locally but on remote machines all Mike saw was...
  • Blog Post: Getting a NullReference Exception Generating WSDL for your Remoted Object?

    Maybe you didn’t know, but you can generate a WSDL document for your remote object fairly easily. You can generate the contract XML directly or you can use soapsuds.exe to generate a proxy dll that you can share with your consumers. All you have to do is make a request to your remote object URI and append...
  • Blog Post: RegAsm error: Cannot write to the registry key.

    C:\Temp \ClassLibrary1\ClassLibrary1\bin>regasm ClassLibrary1.dll Microsoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573 Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. . Types registered successfully . C:\Temp\ClassLibrary1\ClassLibrary1\bin>regasm ClassLibrary1...
  • Blog Post: COM Interop - Releasing unused COM libraries

    Following up with my last post on releasing PInvoked libraries....this time with COM libraries. There's a more robust way to do this for COM libraries. After you're done with your COM libraries and you've released all associated resources (Marshal.ReleaseCOMObject()) you can free all COM libraries that...
  • Blog Post: PInvoke Library Load/Unload Behavior – Freeing Unmanaged Libraries

    What’s the load behavior of dlls that we PInvoke into anyway? The libraries that are pinvoked are loaded when the 1 st call to that function is made. The module will stay loaded in memory until the AppDomain shuts down. Typically this means that the dll will be loaded into your applications memory until...
  • Blog Post: Event ID 1000 – .NET Runtime Warning “Attribute names must be unique.”

    You may find the following event in your Application event log: Event Type: Warning Event Source: .NET Runtime Event Category: None Event ID: 1000 Date: 10/8/2004 Time: 9:35:49 AM User: N/A Computer: WEB5 Description: The description for Event ID ( 1000 ) in Source ( .NET Runtime ) cannot be found. The...
Page 1 of 1 (19 items)