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

I get this error in my Silverlight projects occasionally and even though my projects still compile this error is annoying. I found a quick fix on the Silverlight forums which worked for me. Click on the xaml file causing the error and change the “Custom Tool” setting from MSBuild:MarkupCompilePass1 to MSBuild:CompileXaml and rebuild. The error should no longer appear. Remember to set the custom tool back to MSBuild:MarkupCompilePass1.

Leave a Reply