Wednesday, July 14, 2010 12:21 PM
I’m prepping this week for the 70-515 exam I’m taking on Friday, and I thought I’d go through some VS.NET 2010 labs as part of my prep. One of them has to do with setting up a WCF service, where you create a web application and then add an Entity Framework model file to the project.
Right click, Add New Item, Entity Framework file, and…
Huh. Well that’s weird, considering that this is a .NET 4.0 web application project in Visual Studio.NET 2010…how can it not resolve to the target framework?
So I check to see what framework is being targeted in my web project…maybe its set to the wrong one somehow. To my shock and horror though, I’m greeted to an empty drop list:
What is going on?! I look online, trying to figure out what could be the cause of this bedlam but to no avail. Twitter provided me some input (like the .NET 4 Client Framework, which is a slimmed down version of the full framework and the default for certain projects. See the articles here and here for more info), but nothing to solve my issue specifically.
After doing the uninstall/reinstall dance with .NET 4 (which didn’t fix it), I decided to do it for VS.NET 2010. This time I installed everything but the C++ libraries (I had removed a bunch of stuff from my initial install, but nothing that I thought would cause this…like F# for instance).
I loaded up VS.NET, created a new web project, tried to add an EF file and SAD TUBA! Same error message I got initially about mscorlib not resolving for target .NET 4. Now during my Twitter conversations, it came up about which projects are defaulted to the .NET 4 Client Framework I mentioned above. I tried an experiment: I added a Winform project to the solution.
Loaded it up, tried to add the EF file, and got the SAME ERROR! This time I checked the properties of the Winform project and saw not only a full Target Framework drop down list but that it was defaulted to the .NET 4 Client Framework. So I tried setting it to the full .NET 4 Framework. Guess what happened?
All the frameworks disappeared from the Target Framework drop list!
This is all getting funky…for those reading this blog post hoping that I was going to provide a solution, sorry to disappoint. I’m blogging this as a cry for help because I have NO idea WTF is going on. The fact that a full uninstall/reinstall didn’t fix this is troubling also. If I come to a solution, I’ll add it…but if anyone has some thoughts/insight, please comment below!
D