views:

46

answers:

2

I have recently linked a database to my C# service by creating a LINQ to SQL item in my solution. Everything was fine and dandy as I was continuing to code, but then I suddenly noticed that there where 16 Ambiguity errors. e.g.

Ambiguity between 'EmailService.Properties.Settings.defaultInstance' and 'EmailService.Properties.Settings.defaultInstance'

What happened was that the database file decided to create it's own Setting.Designer.cs; So now I have a Settings.Designer.cs and a Settings1.Designer.cs (which was created by the LINQ to SQL file) in my Properties folder.

Is there anyway that I can change where the database file is referencing its settings so I can delete the duplicate?

A: 

In the dbml designer, in the DataContext properties, there's an option to use app settings that's enabled by default. If you set it to false, it will no longer generate the settings class.

allonym
I do not see this option, and I don't believe that I had even changed anything within the properties.
Immanu'el Smith
open up your dbml, go to the properties window, expand Connection, and you should see a boolean property called "Application Settings".
allonym
A: 

I fixed it manually.

I had to use find and replace to replace all instances that were referencing to Settings1.settings since I couldn't use refactoring; then I had to delete the Settings1.settings file.

You must however make sure that you do not miss a reference otherwise another Settings1.settings will be automatically generated when you rebuild your solution.

Immanu'el Smith