Conversion to .Net Core Issues
-
I converted a .Net Framework WPF app to .Net Core. I now have 1800+ compilation errors. :mad::mad: It seems like 99% of them are
The name 'InitializeComponent' does not exist in the current context
Since this is so widespread, I'm going to assume something in the conversion broke this. I've been Googling and trying different things but no help. I tried removing the obj & bin folders but that didn't solve anything. Anyone have any ideas on this?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
I converted a .Net Framework WPF app to .Net Core. I now have 1800+ compilation errors. :mad::mad: It seems like 99% of them are
The name 'InitializeComponent' does not exist in the current context
Since this is so widespread, I'm going to assume something in the conversion broke this. I've been Googling and trying different things but no help. I tried removing the obj & bin folders but that didn't solve anything. Anyone have any ideas on this?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
Double-check that your project has the correct SDK:
Sdk="Microsoft.NET.Sdk.WindowsDesktop"
Also double-check that in contains<UseWPF>true</UseWPF>
within a<PropertyGroup>
element.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Double-check that your project has the correct SDK:
Sdk="Microsoft.NET.Sdk.WindowsDesktop"
Also double-check that in contains<UseWPF>true</UseWPF>
within a<PropertyGroup>
element.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I opened the project file in Notepad++. The first line of the csproj file is
The second line exists in a PropertyGroup I tried replacing the SDK and recompiled. Same result. 1800+ errors Thanks
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
Double-check that your project has the correct SDK:
Sdk="Microsoft.NET.Sdk.WindowsDesktop"
Also double-check that in contains<UseWPF>true</UseWPF>
within a<PropertyGroup>
element.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I've made a bit more progress on this. The app has multiple configurations. When the configuration is changed, a bar appears at the top that says
Current solution contains incorrect configurations mappings. It may cause projects to not work correctly. Open the Configuration Manager to fix them
None of the code wrapped in an #if / #endif sections are active, so this leads me to believe there's a config issue. Since the project file was converted from .Net Framework to .Net Core, I'm a bit unsure on what to look for. Any thoughts on this? Thanks!
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
I've made a bit more progress on this. The app has multiple configurations. When the configuration is changed, a bar appears at the top that says
Current solution contains incorrect configurations mappings. It may cause projects to not work correctly. Open the Configuration Manager to fix them
None of the code wrapped in an #if / #endif sections are active, so this leads me to believe there's a config issue. Since the project file was converted from .Net Framework to .Net Core, I'm a bit unsure on what to look for. Any thoughts on this? Thanks!
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
It looks like that's related to "conditions" in the csproj referring to configuration profiles that don't exist in the solution. Look for things like:
Debug
and check that the configuration value matches an existing build configuration for your solution: Understand build configurations - Visual Studio (Windows) | Microsoft Learn[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer