New WPF Project Won't Compile -- Throws Error "The name 'InitializeComponent' does not exist in the current context"

StackOverflow https://stackoverflow.com/questions/17453919

Domanda

I'm getting started with WPF, but when I create a new WPF project (usuing all default options) it won't compile after VS generates the project. (Both under C# and VB) I believe I'm running the latest/greatest VS (which is maybe the problem?)

Microsoft Visual Studio Premium 2012 Version 11.0.60610.01 Update 3

Best I could tell none of the answers here provided any help at all. The namespaces/class names are all correct.

È stato utile?

Soluzione 2

Uninstalled the .Net frameworks and reinstalled them and everything works again! BTW, tried reinstalling VS and that had no effect, don't waste your time.

However, very shortly after this I ran into this problem: Error Reading Resource File for any WPF Project in VS2012

However, it worked briefly before the problem started, so I'm not sure if this solution had anything to do with the new problem or not. Just be aware.

Altri suggerimenti

Did you change a file name at any point?

Try Rebuild (not Build).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top