COM Interop

Archived Posts from this Category

The Morning Brew #1195

Posted by on 24 Sep 2012 | Tagged as: .NET, ASP.NET, C#, COM Interop, Database, Development, Links, Morning Brew, SysAdmin

Software

  • jQuery 1.8.2 Released – The jQuery Team announce the release of jQuery 1.8.2, a bugfix and performance regression fix release. As usual the files are available from the jQuery site, and should be making their way to the various content delivery networks.
  • IE 9.0.10 Available via Windows Update – The Internet Explorer Team have released a high importance security patch for Internet Explorer 9 to address recently reported security issues. Additionally there is an update for Internet Explorer 10 to address a Adobe Flash issue.

Information

The Morning Brew #1176

Posted by on 28 Aug 2012 | Tagged as: .NET, COM Interop, Development, Morning Brew

Software

  • C# Yellow Book 2012 Now Available – Rob Miles announces the 2012 edition of his C# Yellow Book, a free pdf download now in its 5th year of being updated. This edition contains updates and corrections, along with moving the GUI section onto XAML rather than WinForms.
  • #mvvmlight V4 update for Win8 RTM – Laurent Bugnion has updated his MVVM Light framework for the Windows 8 RTM release, including a few updates, and discusses upgrading your applications to the RTM release in this post.
  • FsCheck 0.8.3 and FsCheck.Xunit 0.3 – Kurt Schelfthout announces the latest versions of FsCheck and , adding support for running tests through NCrunch, and use of Assembly binding redirects to ensure that thte correct versions of assemblies are used.

Information

Community

The Morning Brew #1169

Posted by on 16 Aug 2012 | Tagged as: .NET, COM Interop, Development, Morning Brew

Update: Fixed a typo suggesting that Scott Hanselman’s Videos were for .NET 3.5 – Thanks to Graham for letting me know via the comments

Unless you’ve been living under a rock for the past 24 hours you will already be aware of some of what follows….

Visual Studio 2012, .NET 4.5 and Windows 8 RTM

Software

  • ASP.NET Web API Released and a Preview of What’s Next – Henrik F Nielsen proudly announces the release of ASP.NET Web API as a part of the Visual Studio and .NET releases, and looks to what the future holds for WebAPI
  • EF5 Released – The Entity Framework Team announce the official release of Entity Framework 5 both on NuGet and also in the box in Visual Studio 2012
  • Web Essentials 2012 released – Mads Kristensen announces the release of Web Essentials 2012, a Visual Studio Extension for Visual Studio 2012 which further enhances the capabilities of the Visual Studio IDE foe all sorts of Web Development tasks.
  • WCF Data Services 5.0.2-rc Prerelease – The WCF Data Services Team announce their next preview release of the WCF Data Services, available as a prerelease package on NuGet.
  • Reactive Extensions v2.0 has arrived! – Bart J.F. De Smet announces the release of the Reactive Extensions 2.0 as a part of the Visual Studio 2012 and .NET 4.5 release. This version also supports .NET 4.0 developments as well as Silverlight 5 and Windows Phone 7.5 in addition to the expected .NET 4.5

Information

Afternoon Tea – Sunday 10th June 2012

Posted by on 10 Jun 2012 | Tagged as: .NET, Afternoon Tea, ASP.NET, C#, COM Interop, Community, Database, Development, Links, Morning Brew, SysAdmin, Talks / Presentations

It’s been quite a while since the last ‘Afternoon Tea’ post, and there have been quite a lot of significant announcements in the past few weeks, coupled with my being busy at work which has resulted in me building up quite a backlog of links which I really wanted to include in a Morning Brew. This post is my attempt to ‘clear the decks’ and get caught up again, and also provides the perfect excuse to do a link roundup of DDD South West which I had the pleasure of presenting at at the end of last month.

Software

  • Introducing jQuery++ – Justin B Meyer and the folsk over at Bitovi announce the release of jQuery++, a collection of DOM helpers which complement and extend jQuery
  • Bundler.NET – Bundler.NET brings the CSS and JavaScript minification and combining features of .NET 4.5 to earlier versions of .NET. The installation is simple via a NuGet package and the API reflects the .NET 4.5 implementation.
  • bddify is moved to GitHub and is renamed to TestStack.BDDfy – Mehdi Khalili gives an update on TestStack.BDDfy, the project formerly known as bddify, discussing the name change, and change to the projects hosting, along with looking at the structure of the NuGet packages which amke up TestStack.BDDfy.
  • #mvvmlight V4 for Windows 8 RP is available – Laurent Bugnion announces the release of version 4 of his MVVMLight framework for Windows 8 Release Preview
  • Get latest CSS 3 support in Visual Studio 2010 – Mads Kristensen discusses how you can get the latest version of the CSS3 support into your Visual Studio 2010 installation providing a link to the schema files required and giving instructions on getting it setup and installed in Visual Studio 2010
  • Tree Surgeon – Alive and Kicking or Dead and Buried? – Bil Simser gives an update on an old tool that I used to make considerable use of in the past. Tree Surgeon was a tool to create a standardized format of Development Source Tree structure. In this post Bil discusses how the landscape of .NET development has changed in the 4 years since its last release with improvements in T4 Templating and NuGet, and questions if there is a future for the project.
  • Introducing RabbitBus – Derek Greer introduces RabbitBus, a .NET client API implementation for working with RabbitMQ, aiming to provide constructs which are not provided in the standard RabbitMQ .NET client. The library is open source with code available on GitHub, and the installation is available in NuGet package format.

Information

DeveloperDeveloperDeveloper South-West 4.0

The Morning Brew #990

Posted by on 28 Nov 2011 | Tagged as: .NET, ASP.NET, COM Interop, Development, Morning Brew, Photography

Disaster struck this morning – I pressed post, waited until the page reloaded and shut my laptop as usual, but for reasons unexplained the post never made it onto the site – So here is today’s edition, a little later than planned – at least its still morning *somewhere* in the world!

Thanks to Libor or letting me know something was wrong

Update: In my haste to resurect today’s post a ‘smart quote’ snook into some HTML merging Sankarsan & Jon Skeets links together – fixed now – thanks to EF for letting me know

Software

  • Simple.Data for Mono – Mark Rendle has got his Simple.Data Dynamic Data Access library up and running under Mono, with most of the tests passing. The Mono release is available as a tgz download from the project’s GitHub Site.

Information

  • New Bundling and Minification Support (ASP.NET 4.5 Series) – Scott Guthrie continues his series of posts looking at the new features of ASP.NET 4.5, currently available in the Developer Preview Release. In this post Scott discusses the new support for bundling and minification of CSS and JavaScript Resources.
  • Inside ASP.NET 4.5 Bundling and Minification – Sankarsan discusses some of the details behind the Bundling and minification, looking at how the functionality is implemented in the framework, discussing how the functionality is called and the interactions between the parts.
  • Eduasync part 17: unit testing – Jon Skeet continues his exploration of the Async / Await functionality of C#5 discussing how it is possible to unit test async code (sometimes), illustrating by showing and discussing some of the tests for his Majority Voting implementation.
  • Razor Donut Caching – Phil Haack discusses the possible look and feel for the re-introduction of donut caching in ASP.NET MVC4, highlighting a package available for MVC3 which adds the functionality and discussing some of the limitations and possible changes to Razor to make creating donut holes easy.
  • REPL for the Rosyln CTP 10/2011 – Chris Sells discusses the Roslyn CTP release and the Read Evaluate Print Loop (REPL) environment, looking into creating a console based REPL environment using Roslyn, showing how easy executing lines of code becomes with Roslyn.
  • Reflection, performance and runtime code generation – Ivan Towlson discusses the use of reflection and code generation with regard to the performance of code where you need to work with types you don’t know at compile time.
  • Building F# Solutions in Visual Studio 11 &
    Traffic Cop – Fresh Brewed Code, a new blogging community site for developers kicks off with posts from Dan Mohl highlighting resources for working with F# in Visual Studio 11, and Jim Cowart sharing an implementation he calls Traffic Cop for situations where he needed to avoid multiple jQuery Ajax requests for the same resources.
  • Method Stubs – Phil Trelford discusses Test Driven Development in F#, focusing particularly on how you don’t need frameworks to implement stubs and spies in F#.
  • 31 Days of Mango | Day #26: Background File Transfer , Day #27: Microphone API &amp Day #28: Media Library – Jeff Blankenburg’s series of posts on Windows Phone Mango continues with three more guest posts, first another from Gary Johnson discussing background file transfer. Next Parag Joshi discusses the Microphone API and the recording of audio, and finally Jeff Fansler takes a look at the Media Library.
  • 10 Laps around Silverlight 5 (Part 7 of 10) – Michael Crump continues his Silverlight 5 series with part 7 exploring operating system integration with a look at power awareness, 64 bit browser support and Save Dialogs.

Community

  • NxtGenUG – Santa Westley – Liam Westley joins the NxtGenUG in Coventry of their User Group meeting on Monday 12th December. There are no details of the session to be delivered, but Liam is an excelent speaker, and will nodoubt be brings some swat and probably some tasty treats too!

When APIs evolve – or how I lost my lunchtime by installing the .NET 2.0 Framework

Posted by on 17 Jan 2007 | Tagged as: .NET, COM Interop, IIS, SysAdmin

In the presentation about Good API Design I talked about in yesterdays post one of the key points made was that once an API is defined you should never make changes to it that will break your client’s code. An example cited throwing exceptions based on values previously considered fine.

As luck would have it I encountered an actual example of precisely this problem today while installing the .NET 2.0 Runtime on a development server. This server runs a number of .NET 1.1 applications and a number of classic ASP applications consuming COM components written in .NET 1.1.

Things didn’t start well, with the framework installer stopping the IIS instance for the better part of 10 minutes while installing, however it did restart it again once it was done (unlike MSDTC and SQL Server when installing anything from the Windows Components section of Add Remove Programs on Windows 2003).

Matters got worse when someone mentioned that one of the components on the server was now misbehaving – specifically one that uses the ASP.NET Cache to provide caching capabilities.

Whenever a web application tried to create this object (via Server.CreateObject) it was getting an invalid pointer error. Other COM components developed in a similar way were working fine, so I assumed there was something wrong with the registration of the component. Un-registering and re-registering the component gave no joy – neither did calling it from a simple VBScript file.

To make matters worse, a simple .NET test application was working just fine using the exact same library.

After a bit of head scratching and pondering the SysInternals (Now a part of Microsoft) Process Explorer revealed that instead of using the .NET 1.1 version of System.Web both CScript and the IIS DLLHost were loading the .NET 2.0 version. The code for the component hadn’t changed, so maybe the .NET framework had.

Loading the source code for the component into Visual Studio 2005 and attempting to compile and run a the simple test application revealed the problem, a Null Reference Exception from within the framework.

As the COM Component was using the ASP.NET System.Web.Cache it was creating a HTTP Context instance internally. This code looked like this:

private System.Web.HttpContext context = new System.Web.HttpContext(null);

Poking round the disassembled code of System.Web in Reflector didn’t reveal what it was that was causing the exceptions, although I did only go a few functions deep, however it did reveal an alternative way of getting to the cache.

Changing our code to use a call to System.Web.HttpRuntime.Cache to obtain the cache instance fixed our problem, and a quick rebuild of the component against .NET 2 and redeploy to the server and we were back up and running.

Lessons learned from all this:

  • The .NET Framework installer will stop IIS and keep it stopped for a large part of the install – useful to know considering I’ll be installing it on some production servers soon
  • Both IIS and CScript seem to run all .NET COM Components through the most up to date version of the .NET framework, regardless of the version the component is registered or compiled with
  • .NET applications (like our test applet) will run in the .NET framework version they were compiled against if available