Tetsujin no Oni
Tetsujin no Oni

Reputation: 7375

Errors on core framework types after changing target framework to .Net Framework 4.0.1

When working with an existing project that has been changed from .Net Framework 4.0 to .Net Framework 4.0.1 (formally, Microsoft .NET Framework 4 Platform Update 1 - Runtime Update (KB2478063) ) in Visual Studio using the project properties, core types (i.e. int and string) become undefined. What's broken and how do you fix it?

Upvotes: 3

Views: 248

Answers (1)

Tetsujin no Oni
Tetsujin no Oni

Reputation: 7375

In the project references, the reference to mscorlib appears to be deleted as part of the update mechanism which changes the target framework version. Adding a new <Reference Include="System.Core">4.0.1 entry to the project file cures the issue. This appears to need to be done in a text editor, as the built-in tooling doesn't provide an obvious control to force the reference back in.

Upvotes: 4

Related Questions