Settings1.Designer.cs Bug: Multiple settings files

Posted by: Dan Fernandezs Blog, on 28 Apr 2008 | View original | Bookmarked: 0 time(s)

I ran into this bug today which was unfortunately closed as can't repro. I was renaming some AppSettings variable names (right click on a Project's  Properties and go to the Settings tabs) and deleting some other settings, when I did a Search/Replace for the entire solution and somehow wound up with a duplicate Settings.Designer.cs file named Settings1.Designer.cs. This was effectively a clone of Settings.Designer.cs which meant:

  • IntelliSense would report that any AppSettings variables were declared multiple times
  • The project wouldn't compile because the variables were already declared

The fix was to

  • From the Error menu, double click the Settings1.Designer.cs file to open it. Right click on the file and select Open Containing Folder and backup the the offending file(s) first (just in case).
  • After backing up, delete the Settings1.Designer.cs file
  • Switch back to VS and ensure Show All Files is selected in the Solution Explorer
  • Expand Settings.settings in the Solution Explorer and manually delete Settings1.Designer.cs (and if prompted say yes to removal from source control)
  • Select Build...Clean Project... (or Solution as appropriate)

You should be good to go, if you get an error about a missing file, you may need to manually open your csproj or sln file in Notepad and ensure that the MSBuild script doesn't contain a link to Settings1.Designer.cs.

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: .NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1391 | Hits: 18

Similar Posts

  • New Release: BGI SCORM LMS Portal v2.5.0 - New Certification Manager with WYSIWYG Certificate Designer - DotNetNuke Integrated more
  • JavaScript >> Get Any CSS Property Value of an Object using $style more
  • How to define state machine in Windows Workflow Foundation (WF) more
  • Emacs is better than Visual Studio as a C# Development Tool?!! more
  • Team Foundation Server and the missing file sharing (Part 2) more
  • Embedding EDM schema files in Entity Framework Beta 3 more
  • Sharing Entity Framwork models between projects (or teams) when developing more
  • Apache and ScriptMaps - It's killing me! more
  • How to create Silverlight Applications with Notepad more
  • My "First Look at Orcas" Presentation more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD