0

I'm working on a WCF Service with Visual Studio Comunity 2015. After upgrade my machine to Windows 10, and trying to start my project i get this error:

enter image description here

Any ideas? Thanks!

EDIT

Ok. I remove the reference and any the DLL from project subfolders. Try and nothing. I reference the DLL and nothing. One thing I notices is that if i reference the DLL from C:\Windows\System32\inetsrv (version 10.0.10240) and open the .csproj file i see this:

<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\..\..\..\..\..\Windows\System32\inetsrv\Microsoft.Web.Administration.dll</HintPath>
</Reference>

Wich is a diferent version from the one i have in my system.

EDIT II So I try to remove all the references to Microsoft.web.Administration, clean the solution and then add the reference to the file in C:\Windows\System32\inetsrv. After that clean again and recompile. When I open the .csproj file I see this:

<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\..\..\..\..\..\..\Windows\System32\inetsrv\Microsoft.Web.Administration.dll</HintPath>
</Reference>

The version is different from the one in my system. What do I do now?

ericpap
  • 2,917
  • 5
  • 33
  • 52
  • possible duplicate of [ServerManager constructor crashes in test environment](http://stackoverflow.com/questions/12405595/servermanager-constructor-crashes-in-test-environment) – paulsm4 Sep 22 '15 at 01:10

1 Answers1

1

This error occurs when MSVS is trying to start the wrong version of Microsoft.Web.administration.

You can check for your current version here:

C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll

You can edit your project file (e.g. in notepad) to correct the discrepancy.

Relevant links:

Community
  • 1
  • 1
paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • Thanks for the help, but i can't figure out what do i need to change. The file you mention (C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll) is version 10.0.10240. I don't have a reference in my host project to that library. – ericpap Sep 22 '15 at 02:18
  • I try to reference this file in my project and get the same error – ericpap Sep 22 '15 at 02:18
  • OK: that's definitely the problem. You got a new Microsoft.Web.Administration .dll when you upgraded ... and MSVS doesn't know about it. Just do a global search in your project subfolders. Alternatively, you might consider browsing to the new, current .dll in MSVS > Project > Add References. – paulsm4 Sep 22 '15 at 02:26
  • Yes. That's exactly what I was trying to say. Change "7.9.0.0" to "10.0.10240" in your .csproj! Does it work? PS: ".csproj" is what I meant by your "Project file". – paulsm4 Sep 22 '15 at 02:42
  • No, same problem. Also try add the reference with nuget, but same problem – ericpap Sep 22 '15 at 02:45
  • Do this: 1) MSVS > Solution References > Add reference > Browse, add your current C:\Windows\System32\inetsrv\Microsoft.Web.Administration.dll. 2) Save All, Clean and Rebuild your project, 3) Make sure the .csproj now says "Version=10.0.x.x". *IT WILL ALSO HAVE A DIFFERENT PublicKeyToken* 4) Post back what you find, 5) Post back if you encounter any problems doing this – paulsm4 Sep 22 '15 at 04:39
  • The problem is clear. The solution *should* be simple - I'm not sure why it hasn't worked for you yet. Please read this: [Don't use the MWA packages at NuGet](https://blog.lextudio.com/2015/05/whats-microsoft-web-administration-and-the-horrible-facts-you-should-know/) – paulsm4 Sep 23 '15 at 07:57
  • Thanks for your help. Solution wasn't simple at all. I have to re-install windows 10 from scratch and reinstall VS2015 and everything worked like it should. Thanks for your effort! – ericpap Sep 23 '15 at 13:03