George2
George2

Reputation: 45771

open WCF svc file error in IIS

I am using VS2010 + C# + .Net 4.0 + IIS 7.5 + Windows 7. When I open a WCF svc file in IIS 7.0, there is some error like this, any ideas what is wrong?

System.BadImageFormatException: Could not load file or assembly 'foo.test' or one of its dependencies.

Upvotes: 0

Views: 763

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038780

Probably the application pool is configured to target CLR 2.0. You need to change it to target .NET 4.0:

alt text

Also make sure .NET 4.0 is registered by running:

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

Upvotes: 2

Related Questions