I have tried googling this issue, and resolving it myself, but sadly no luck.
I have not been wanting to make this as this seems like a very beginner mistake, but I just can't wrap my head around the issue here.
Steps to recreate:
- Fire up Visual Studio 2019 on Windows and create a C# .NET5 Console App
- Write some code or don't, add 2 other projects to the solution (both winforms) and build the console app.
- Add the settings file in the project.
- Try to build.
expected result:
app builds no problem, settings are normal.
actual result:
app doesnt build, settings.designer.cs
throws the following error
Severity Code Description Project File Line Suppression State Error CS1069 The type name 'ApplicationSettingsBase' could not be found in the namespace 'System.Configuration'. This type has been forwarded to assembly 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' Consider adding a reference to that assembly. AppName D:\projects\AppName\AppName\AppNameSubBranch\AppNameSubBranch\Settings.Designer.cs 16 N/A
Debugging information
Building x86 EXE file with Visual Studio 2019 | .NET5 Console App with no NuGet Packages installed. | Running everything on Windows 10 Home x64.
The error is being thrown at line 16
ApplicationSettingsBase
and line 18
global::System.Configuration.ApplicationSettingsBase
Full settings.designer.cs code:
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace AppName{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static ShellSettings defaultInstance = ((ShellSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new ShellSettings())));
public static ShellSettings Default {
get {
return defaultInstance;
}
}
}
}
If further information or clarification is needed, please leave a comment.
I want to add aswell that there are no problems in previous console apps and in the winforms projects that I did. It's something with this one that is wrong.