问题
I am building a WPF project on VS2013 Community. I wanted to use CefSharp
in the project, but it cannot run on AnyCPU
build configuration, so I changed it to x86
. After that MainWindow.xaml.cs started throwing The name 'InitializeComponent' does not exist in the current context
and 25 more errors saying that none of my XAML control's names can be found. When I change to x64
it's the same. When I return to AnyCPU
the project compiles and runs perfectly.
So what else do I need to change in the configuration in order to make it work?
EDIT: I finally decided to drop CefSharp and returned the AnyCPU option everywhere. Now VS gives me the same errors only when building for Release. I reverted to the last stable version of the project in Git, but the errors won't go away. I've looked at Debug/Release settings in Configuration manager
and Project properties
, but everything seems fine. Is there somewhere else to look for Release settings?
来源:https://stackoverflow.com/questions/30710557/the-name-does-not-exist-error-when-switching-target-platform-from-anycpu-to-x8