1

I've written a C# DLL that performs some data gathering and manipulation using Entity Framework. The DLL is COM compatible and is designed to be called by a legacy VB6 application. It is using .NET 3.5 using Visual Studio 2010

THe DLL works perfectly in the development environment and in the staging environment, both Windows 2003 Server. However when it was deployed to the Live environment (also Windows Server 2003) the DLL threw an error when it was being RegAsm'd. The error was

RA0000 Binary format of the specified custom attribute was invalid

The DLL compiles fine and the Live environment has other .NET 3.5 components we have written installed on it as well (although nothing that uses Entity Framework). Deployment files are the same on Live and Staging.

I'm struggling to find any reason for this. I was hoping someone else out here had any suggestions or ideas?

Thanks in advance

Ian Boggs
  • 522
  • 3
  • 16
  • Can you run it in [Linqpad](https://www.linqpad.net/) with the dll's from Production and the block of code you suspect is causing the issue? – lloyd Nov 17 '17 at 08:59
  • Are you sure you are running the correct (32-bit or 64-bit) version of RegAsm on the Live server? – spodger Nov 17 '17 at 09:06
  • @lloyd I'm not entirely sure which block of code is causing the error as the error is when I'm registering the DLL during the install process, I'll have a look at Linqpad though. – Ian Boggs Nov 17 '17 at 09:08
  • @spodger As we are running on Windows Server 2003 there is only the 32 bit version on all the servers. We are explicitly calling regAsm from the 'C:\Windows\Microsoft.Net\Framework' folder – Ian Boggs Nov 17 '17 at 09:10

1 Answers1

0

It appears that the issue was the .NET 3.5 SP1 wasn't installed on the Live server, but was installed in Dev and Staging.

So much for matching environments. Once SP1 was installed, the DLL registered and worked as expected

Ian Boggs
  • 522
  • 3
  • 16