views:

140

answers:

2

A few days ago my .NET 3.5 applications began to fail while start issuing the error

"Unable to find a version of the runtime to run this application".

As I did not do anything with them, this looked weird to me. After some investigation, I discovered, that the reason is Windows automatic update which installed service pack for .NET 3.5 or .NET 4 to my computer (I did not figure which of two is guilty). That update was not be possible to uninstall as it was not shown in Installed Windows updates list at Control Panel. I had to revert to system restore point!

Today one of my customers complained to the same problem. I cannot force him to revert to system restore so I need to know how to overcome this silly Microsoft thing. Can anyone please share your ideas on that?

P.S. The software is protected with CodeVeil 1.2, maybe this matters.

+1  A: 

Before we can suggest a fix to this we need to understand what is happening here. The first step to solving this is to get a bit more information

  • What version of the CLR is your application compiled against?
  • What versions of the CLR are installed on the machine?
  • What operating system is the machine?

Typically this error message occurs when the application is compiled for a version of the CLR which is not installed on the machine. For example having a 2.0 application but only a 4.0 CLR.

JaredPar
On my machine I have 3.5 (oh yes, this is 2.0 actually:). The application is compiled to use 3.5. The software works before the update was installed. I did not do anything so this is update which broken the software. I revert to system restore and the software works again.My Windows is 7, 64 bit.
Alex
@JaredPar: That's funny, isn't it? Microsoft didn't manage to design their CLR backwards compatible?
chiccodoro
@chiccodoro, the CLR is largely backwards compatible but true 100% backwards compatibility means you can't really change much at all. Lots of fun examples where very subtle changes cause hard to track down problems in applications. This is one of the reasons they decided that 2.0 apps will not **automatically** upgrade to the 4.0 CLR. It can be done by added the supportedRuntimes entry in the .config file.
JaredPar
@Alex if there was an update it should be showing up in one of the logs. Have you checked the "Programs and Features" entry in Control Panel and clicked "View Installed Updates"?
JaredPar
A: 

Thanks everybody for help!

I finally figured out that this is old CodeVeil which was guilty in the ruining the application. After .NET 4.0 update was installed, all applications protected by CodeVeil 1.2 were completely broken. I purchased newest version of the product and it now works.

Alex