The name ‘InitializeComponent’ does not exist in the current context

If when creating a WPF control you get the above error on building your project then you are missing the following line from the csproj file: –

<Import Project=”$(MSBuildBinPath)\Microsoft.WinFX.targets” />

Add this and all will be well.

Advertisements

4 Responses to “The name ‘InitializeComponent’ does not exist in the current context”

  1. mjwills Says:

    You just saved me another hour of pulling my hair out.

  2. Madhav Says:

    I have created a WPF user control in a windows forms application, i have the above proble. but your solution did not work. Please let me know if i am doing anything wrong

  3. debsalinas14815 Says:

    Anna: What a good deed! I like it! Watch for a post next week entitled “10 things you can do to bless total strangers.” Click http://s.intmainreturn0.com/hukcoo091645

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: