Compiler Error Message: CS0117: 'SumaCard.Properties.Settings' does not contain a definition for 'De

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have had my original p[roject kind of crash so I am recreating the project. BUT after I have added some of the exisiting (old) code pages to the App_Code folder there I get the error above.
<span>The complete error is as follows...<span style="font-family:Arial,Helvetica,Geneva,SunSans-Regular,sans-serif <span style="font-family:Verdana Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
<br/>
<br/>
<span style="font-family:Verdana Compiler Error Message: CS0117: SumaCard.Properties.Settings does not contain a definition for Default<br/>
<br/>
<span style="font-family:Verdana Source Error: <br/>
<br/>

<table border="0" width="100%" bgcolor="#ffffcc
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td>
Code:
<pre>Line 205:      try
Line 206:      {
<span style="color:red Line 207:        myDC.AppTitle = Settings.Default.AppTitle;
Line 208:        DataTable resultDT = myDC.QueryDataGet("FileProcessed_Q", pFileName, "FileName");
Line 209:        rowsAffected = resultDT.Rows.Count;
[/code]</td>
</tr>
</tbody>
</table>
<br/>
<span style="font-family:Verdana Source File: c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeFileMoveFTPtoDB.cs
<span style="font-family:Verdana Line: 207 <br/>
<br/>
<br/>

Compiler Warning Messages:
<div id="x_warningDiv" style=" <span style="font-family:Verdana Warning: CS0168: The variable ex is declared but never used<br/>
<span style="font-family:Verdana Source Error: <br/>
<br/>

<table border="0" width="100%" bgcolor="#ffffcc
<tbody>
<tr>
<td> <span style="font-family:Verdana c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeErrorLog.cs </td>
</tr>
<tr>
<td>
Code:
<pre>Line 114:         
Line 115:      }
<span style="color:red Line 116:      catch (Exception ex)
Line 117:      {
Line 118:     //    MessageBox.ShowMessage("An error occured when writing to the Log File. " + ex, "PJS Data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
[/code]</td>
</tr>
</tbody>
</table>
<br/>
<span style="font-family:Verdana Warning: CS0168: The variable e is declared but never used<br/>
<span style="font-family:Verdana Source Error: <br/>
<br/>

<table border="0" width="100%" bgcolor="#ffffcc
<tbody>
<tr>
<td> <span style="font-family:Verdana c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeErrorLog.cs </td>
</tr>
<tr>
<td>
Code:
<pre>Line 140:
Line 141:      }
<span style="color:red Line 142:      catch (Exception e)
Line 143:      {
Line 144:      //   MessageBox.ShowMessage("New Log file failed to be created. " + e, "PJS Data", MessageBoxButtons.OK, MessageBoxIcon.Information);
[/code]</td>
</tr>
</tbody>
</table>
<br/>


Show Detailed Compiler Output:
<div id="x_compilerOutputDiv" style=" <br/>
<table border="0" width="100%" bgcolor="#ffffcc
<tbody>
<tr>
<td>
Code:
<pre>C:Program Files (x86)Common FilesMicrosoft SharedDevServer10.0> "C:WindowsMicrosoft.NETFrameworkv4.0.30319csc.exe" /t:library /utf8output /R:"C:WindowsMicrosoft.NetassemblyGAC_32System.EnterpriseServicesv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.EnterpriseServices.dll" /R:"C:WindowsassemblyGAC_MSILMicrosoft.ReportViewer.WebForms10.0.0.0__b03f5f7f11d50a3aMicrosoft.ReportViewer.WebForms.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.CSharpv4.0_4.0.0.0__b03f5f7f11d50a3aMicrosoft.CSharp.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Drawingv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Drawing.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Windows.Formsv4.0_4.0.0.0__b77a5c561934e089System.Windows.Forms.dll" /R:"C:WindowsMicrosoft.NETFrameworkv4.0.30319mscorlib.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Configurationv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Configuration.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.DynamicDatav4.0_4.0.0.0__31bf3856ad364e35System.Web.DynamicData.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.ApplicationServicesv4.0_4.0.0.0__31bf3856ad364e35System.Web.ApplicationServices.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Data.Entityv4.0_4.0.0.0__b77a5c561934e089System.Data.Entity.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_32System.Webv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xmlv4.0_4.0.0.0__b77a5c561934e089System.Xml.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_32System.Datav4.0_4.0.0.0__b77a5c561934e089System.Data.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModelv4.0_4.0.0.0__b77a5c561934e089System.ServiceModel.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Designv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Design.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Entityv4.0_4.0.0.0__b77a5c561934e089System.Web.Entity.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Runtime.Serializationv4.0_4.0.0.0__b77a5c561934e089System.Runtime.Serialization.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILMicrosoft.Build.Frameworkv4.0_4.0.0.0__b03f5f7f11d50a3aMicrosoft.Build.Framework.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Extensionsv4.0_4.0.0.0__31bf3856ad364e35System.Web.Extensions.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.IdentityModelv4.0_4.0.0.0__b77a5c561934e089System.IdentityModel.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Activationv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Activation.dll" /R:"C:WindowsassemblyGAC_MSILMicrosoft.ReportViewer.Common10.0.0.0__b03f5f7f11d50a3aMicrosoft.ReportViewer.Common.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystemv4.0_4.0.0.0__b77a5c561934e089System.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Activitiesv4.0_4.0.0.0__31bf3856ad364e35System.Activities.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ComponentModel.DataAnnotationsv4.0_4.0.0.0__31bf3856ad364e35System.ComponentModel.DataAnnotations.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Extensions.Designv4.0_4.0.0.0__31bf3856ad364e35System.Web.Extensions.Design.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Xml.Linqv4.0_4.0.0.0__b77a5c561934e089System.Xml.Linq.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Activitiesv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Activities.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.WorkflowServicesv4.0_4.0.0.0__31bf3856ad364e35System.WorkflowServices.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Web.Servicesv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Web.Services.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Webv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Web.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Data.DataSetExtensionsv4.0_4.0.0.0__b77a5c561934e089System.Data.DataSetExtensions.dll" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Corev4.0_4.0.0.0__b77a5c561934e089System.Core.dll" /R:"C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374assemblydl35558671fca94ac6d_fb9acb01SumaCard.DLL" /R:"C:WindowsMicrosoft.NetassemblyGAC_MSILSystem.Managementv4.0_4.0.0.0__b03f5f7f11d50a3aSystem.Management.dll" /out:"C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701 /warnaserror- "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.0.cs" "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.1.cs" "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.2.cs" "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.3.cs" "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.4.cs" "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.5.cs" "C:UsersPhillip J SeamanAppDataLocalTempTemporary ASP.NET Filesroot1a0ae4b8295f6374App_Code.pf8gv2ec.6.cs"


Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeErrorLog.cs(116,30): warning CS0168: The variable ex is declared but never used
c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeErrorLog.cs(142,30): warning CS0168: The variable e is declared but never used
c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeFileMoveFTPtoDB.cs(207,42): error CS0117: SumaCard.Properties.Settings does not contain a definition for Default
c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeFileNames.cs(40,38): error CS0117: SumaCard.Properties.Settings does not contain a definition for Default
c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeFileNames.cs(44,38): error CS0117: SumaCard.Properties.Settings does not contain a definition for Default
c:UsersPhillip J SeamanDocumentsVisual Studio 2010ProjectsTest SQLTest SQLApp_CodeOleDBDataClass.cs(58,46): error CS0103: The name Settings does not exist in the current context
[/code]</td>
</tr>
</tbody>
</table>


Show Complete Compilation Source:
<div id="x_dynamicCodeDiv" style=" <br/>
<table border="0" width="100%" bgcolor="#ffffcc
<tbody>
<tr>
<td>
Code:
<pre>Line 1:  using System;
Line 2:  using System.Collections.Generic;
Line 3:  using System.Text;
Line 4:  using System.Diagnostics;
Line 5:  using System.IO;
Line 6:  using System.Data;
Line 7:  using System.Data.OleDb;
Line 8:  
Line 9:  using System.Configuration;
Line 10:  using System.Web;
Line 11:  using System.Web.Security;
Line 12:  using System.Web.UI;
Line 13:  using System.Web.UI.HtmlControls;
Line 14:  using System.Web.UI.WebControls;
Line 15:  using System.Web.UI.WebControls.WebParts;
Line 16:  
Line 17:  using SumaCard.App_Code;
Line 18:  
Line 19:  namespace SumaCard
Line 20:  {
Line 21:  
Line 22:    public class ErrorLog
Line 23:    {
Line 24:      // --------------- Error MessageBox -------------------------
Line 25:      private string varErrorButtonValue;
Line 26:      public string ErrorButtonValue
Line 27:      {
Line 28:        get { return varErrorButtonValue; }
Line 29:        set { varErrorButtonValue = value; }
Line 30:      }
Line 31:  
Line 32:      private string varErrorMessage;
Line 33:      public string ErrorMessage
Line 34:      {
Line 35:        get { return varErrorMessage; }
Line 36:        set { varErrorMessage = value; }
Line 37:      }
Line 38:  
Line 39:      private string varErrorIconValue;
Line 40:      public string ErrorIconValue
Line 41:      {
Line 42:        get { return varErrorIconValue; }
Line 43:        set { varErrorIconValue = value; }
Line 44:      }
Line 45:      private string varErrorModule;
Line 46:      public string ErrorModule
Line 47:      {
Line 48:        get { return varErrorModule; }
Line 49:        set { varErrorModule = value; }
Line 50:      }
Line 51:      private int varErrorCode;
Line 52:      public int ErrorCode
Line 53:      {
Line 54:        get { return varErrorCode; }
Line 55:        set { varErrorCode = value; }
Line 56:      }
Line 57:  
Line 58:      // ---------------End Error MessageBox ------------------------
Line 59:      // ------------ Log File --------------------------------------
Line 60:      private string varLogName;
Line 61:      public string LogFileName
Line 62:      {
Line 63:        get { return varLogName; }
Line 64:        set { varLogName = value; }
Line 65:      }
Line 66:      private int varLogCode;
Line 67:      public int LogCode
Line 68:      {
Line 69:        get { return varLogCode; }
Line 70:        set { varLogCode = value; }
Line 71:      }
Line 72:      private string varLogModule;
Line 73:      public string LogModule
Line 74:      {
Line 75:        get { return varLogModule; }
Line 76:        set { varLogModule = value; }
Line 77:      }    
Line 78:      private string varLogMessage;
Line 79:      public string LogMessage
Line 80:      {
Line 81:        get { return varLogMessage; }
Line 82:        set { varLogMessage = value; }
Line 83:      }
Line 84:  
Line 85:    // ---------------- End of Log File --------------------------------
Line 86:      public void LogMessageToFile()
Line 87:      {
Line 88:        
Line 89:        string path = SetPath();
Line 90:        StreamWriter sw;
Line 91:  
Line 92:        if (varLogName == null)
Line 93:        {
Line 94:          varLogName = "ErrorLog.dat";
Line 95:        }
Line 96:        
Line 97:        try
Line 98:        {
Line 99:          
Line 100:         if (File.Exists(path + varLogName))
Line 101:         {
Line 102:           sw = System.IO.File.AppendText(path + varLogName);
Line 103:         }
Line 104:         else
Line 105:         {
Line 106:           sw = System.IO.File.CreateText(path + varLogName);
Line 107:           // Create an instance of StreamWriter to write text to a file.
Line 108:           // The using statement also closes the StreamWriter.
Line 109:           sw = new StreamWriter(path + varLogName);
Line 110:         }
Line 111:         string logLine = System.String.Format("{0:G}: {1}.", System.DateTime.Now, " / " + LogCode + " / " + LogModule + " - " + LogMessage);
Line 112:         sw.WriteLine(logLine);
Line 113:         sw.Close();
Line 114:          
Line 115:       }
Line 116:       catch (Exception ex)
Line 117:       {
Line 118:      //    MessageBox.ShowMessage("An error occured when writing to the Log File. " + ex, "PJS Data", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Line 119:       } 
Line 120:        
Line 121:     }
Line 122: 
Line 123:     private string SetPath()
Line 124:     {
Line 125:       // Specify the directories you want to manipulate.
Line 126:      // string path = Directory.GetCurrentDirectory() + "\Log\";
Line 127:       //string path = Application.UserAppDataPath + "\Log\";
Line 128:        string rootPath = HttpContext.Current.Request.MapPath("~");
Line 129:       rootPath = rootPath + "Log\";
Line 130: 
Line 131:       try
Line 132:       {
Line 133:         // Determine whether the directory exists.
Line 134:         if (!Directory.Exists(rootPath))
Line 135:         {
Line 136:           // Create the directory it does not exist.
Line 137:           Directory.CreateDirectory(rootPath);
Line 138:         }
Line 139:         return rootPath;
Line 140: 
Line 141:       }
Line 142:       catch (Exception e)
Line 143:       {
Line 144:       //   MessageBox.ShowMessage("New Log file failed to be created. " + e, "PJS Data", MessageBoxButtons.OK, MessageBoxIcon.Information);
Line 145:         return rootPath;
Line 146:       }
Line 147:     }
Line 148:   }
Line 149: }
[/code]</td>
</tr>
</tbody>
</table>

<br/>

<hr size="1
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif
<span style="font-family:Verdana Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
</font>

<h1>Server Error in / Application.
<hr size="1
</h1>
Compilation Error

<hr class="sig SquireDude

View the full article
 
Back
Top