0
Vote

DatabaseSpace: The VB solution builds failed after converting to VS2008 solution due to the object “My.Settings”.

description

Description:

The same issue also repro on the followed samples:
 
Samples\Engine\Data Access\ADO\MARS\VB
Samples\Engine\Programmability\SMO\SmoScripter\VB
Samples\Engine\Programmability\SMO\SmoCompare\VB
Samples\Engine\xml\ XmlSurvey\VB
Samples\Engine\xml\ XmlOnlineCatalog\VB
Samples\Engine\Fulltextsearch\ItemFinder\VB
Samples\Engine\Programmability\CLR\ArrayParameter\CS
Samples\Engine\Programmability\CLR\ArrayParameter\VB

Environment:

  1. Win2k3 ENT ENU
  2. Installed Katmai 10.0.1049.2
  3. Installed Sample build 80315
  4. Installed VS 2008 9.0.21022.8 RTM
     

Repro Steps:

  1. Locate to “…\Samples\Engine\Programmability\SMO\DatabaseSpace\VB”.
  2. Open DatabaseSpace.sln via VS 2008 and convert it as default settings.
  3. Build the solution via VS 2008.
     

Expectations:

It should be built successfully without error.
 

Actual Results:

Sample build failed with 1 error at line 34 of auto-generated code file "Settings.Designer.vb", the error is: "Reference to a non-shared member requires an object reference."
The code where error occcured is: "My.Settings.Save()"
 

Comments:

If replace “My.Settings” with “My.Settings.Default”, sample could be build without error.

comments

wrote Apr 20, 2009 at 7:55 AM

DatabaseSpace(VB)Programmability\SMO\DatabaseSpace\VB\DatabaseSpace\My Project\Settings.settingsModify Line==>2<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"><SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
MARS(VB)This sample was removed.
 
SmoScripter(VB)Programmability\SMO\SmoScripter\VB\SmoScripter\My Project\Settings.settingsModify Line==>2<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"><SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
 
SmoBrowser(VB)Programmability\SMO\SmoBrowser\VB\SmoBrowser\My Project\Settings.settings<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"><SettingsFile xmlns="uri:settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
 
SmoCompare(VB)Programmability\SMO\SmoCompare\VB\SmoCompare\My Project\Settings.settings<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"><SettingsFile xmlns="uri:settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
 
XmlSurvey(VB)XmlSurvey\VB\XmlSurvey\My Project\Settings.settingsModify Line==>2<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"><SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
 
XmlOnlineCatalog(VB)XmlOnlineCatalog\VB\XmlOnlineCatalog\My Project\Settings.settingsModify Line==>2<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"><SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
 
ItemFinder(VB)Full Text Search\ItemFinder\VB\ItemFinder\My Project\Settings.settingsModify Line==>2<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"><SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
 
ArrayParameter(CS)Programmability\CLR\ArrayParameter\CS\TestArrayParameter\Properties\Settings.csModify Line==>21        public static Settings Value {        public static Settings Default {
Programmability\CLR\ArrayParameter\CS\TestArrayParameter\Program.csModify Line==>55            using (SqlConnection connection = new SqlConnection(Settings.Value.connectionString))            using (SqlConnection connection = new SqlConnection(Settings.Default.connectionString))
ArrayParameter(VB)Remove File==>Programmability\CLR\ArrayParameter\VB\TestArrayParameter\Settings.vb

wrote Nov 24, 2009 at 4:41 AM

This issue only repro on this sample "Samples\Engine\Programmability\SMO\SmoCompare\VB".

wrote Feb 14, 2013 at 2:50 AM