Click here to Skip to main content
15,904,023 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Deploying website on Windows XP computer? Pin
Pete O'Hanlon12-Jul-11 23:25
mvePete O'Hanlon12-Jul-11 23:25 
QuestionRegex Pin
Morgs Morgan11-Jul-11 21:42
Morgs Morgan11-Jul-11 21:42 
AnswerRe: Regex Pin
Pete O'Hanlon11-Jul-11 21:50
mvePete O'Hanlon11-Jul-11 21:50 
GeneralRe: Regex Pin
Morgs Morgan11-Jul-11 22:06
Morgs Morgan11-Jul-11 22:06 
QuestionGridview merge cells with edit button Pin
C#Coudou11-Jul-11 15:11
C#Coudou11-Jul-11 15:11 
Questionpass data between different views in MVC in c#.net Pin
siva45511-Jul-11 7:12
siva45511-Jul-11 7:12 
AnswerRe: pass data between different views in MVC in c#.net Pin
Anurag Gandhi11-Jul-11 20:28
professionalAnurag Gandhi11-Jul-11 20:28 
QuestionCustom Configuration section Pin
indian14311-Jul-11 6:02
indian14311-Jul-11 6:02 
Hi,

I am trying to use custom configuration section in my application in the following way. But its giving me the as below, Did I do any mistake. What should I do when I get assembly load error. I have given the path and every thing correct only. What is the vshost.exe.config file.

Any body please help me any sort of help would be greatly appreciated. Thanks in advance.

An error occurred creating the configuration section handler for FamsTechnologyGroup/QUTransUnionSimulator: Could not load file or assembly 'FTG.QUTransUnionDataViewer' or one of its dependencies. The system cannot find the file specified. (C:\DEV\QUTU\Apps\QuarterlyUpdate\Ftg.Systems.QUTransUnionDataViewer\bin\Debug\Ftg.Systems.QUTransUnionDataViewer.vshost.exe.config line 5)



App Config

<configSections>
    <sectionGroup name="FamsTechnologyGroup">
      <section name="QUTransUnionSimulator"
                           type="Ftg.Systems.QUTransUnionDataViewer.QUTransUnionSimulatorConfiguration, FTG.QUTransUnionDataViewer"
                           allowLocation="true"
                       allowDefinition="Everywhere"/>
    </sectionGroup>
  </configSections>


  <!-- Custom configuration tags -->
  <FamsTechnologyGroup>
    <QUTransUnionSimulator
                           
                         InputFileFormat="INPUT"
                         ISMissing="True"
                         MissingSSN="555555555, 999999999, 888888888"
                         ISError="True"
                         ErrorSSN="000000000, 111111111"
                         CannedSuccessFilePath="\CannedReports\TU.CANNED.SUCCESS.pgp"
                         CannedErrorFilePath="\CannedReports\TU.CANNED.ERROR.pgp"
                           />

    <DataAccess DefaultAuditIdentifier="QUTransUnionSimulator" />
    <ExceptionHandling LogName="Application" EventSource="FTG QUTransUnionSimulator"  />

    <!-- Service startup settings, built into the heartbeat framework -->


    <!-- Service scheduling configration, built into the heartbeat framework -->
    <ServiceConfiguration>
      <Service ServiceType="QUTransUnionSimulator">
        <HeartbeatServiceScheduler>
          <ProcessingWindows>
            <ProcessingWindow>
              <Parameters CheckForWorkInterval="00:01:00" Enabled="true" />
            </ProcessingWindow>
          </ProcessingWindows>
        </HeartbeatServiceScheduler>
      </Service>

    </ServiceConfiguration>
  </FamsTechnologyGroup>  

And Code that is trying to access the custom configuration section is
            QUTransUnionSimulatorConfiguration obj =
            (QUTransUnionSimulatorConfiguration)System.Configuration.ConfigurationManager.GetSection(
            "FamsTechnologyGroup/QUTransUnionSimulator");
            string cannedSuccessFileName = obj.CannedSuccessFilePath;
            string cannedErrorFileName = obj.CannedErrorFilePath;


Custom Config Class
    /// <summary>
    /// Configuration values for the Ftg.DAL library.
    /// </summary>
    [ConfigurationSectionName("FamsTechnologyGroup/QUTransUnionSimulator")]
    public class QUTransUnionSimulatorConfiguration : ConfigurationSection //: HeartbeatServiceConfiguration
    {

        //public override ServiceType ServiceType
        //{
        //    get { return ServiceType.QUTransUnionSimulatorService; }
        //}

        /// <summary>
        /// Convenience method for application code to obtain the Configuration values for
        /// the Ftg.ManifestPreProcessor library.
        /// </summary>
        /// <returns></returns>
        public static QUTransUnionSimulatorConfiguration GetConfig()
        {
            QUTransUnionSimulatorConfiguration config = ConfigurationHelper<QUTransUnionSimulatorConfiguration>.GetConfig();
            return config;
        }

        /// <summary>
        /// Default constructor. 
        /// </summary>
        public QUTransUnionSimulatorConfiguration() { }
        private static QUTransUnionSimulatorConfiguration sInstance;

        /// <summary>
        /// One time type initializer. Reads values from the app/web config file and initializes
        /// the static Instance member.
        /// </summary>
        static QUTransUnionSimulatorConfiguration()
        {
            try
            {
                sInstance = ConfigurationHelper<QUTransUnionSimulatorConfiguration>.GetConfig();
            }
            catch (Exception)
            {
                sInstance = new QUTransUnionSimulatorConfiguration();
            }
        }

        /// <summary>
        /// Singleton instance used by application code to access configuration settings
        /// </summary>
        public static QUTransUnionSimulatorConfiguration Instance
        {
            get { return sInstance; }
        }

        //// By overriding this method, we prevent the framework from marking the
        //// collection as read only, which is required if you want to support programmatic
        //// modification of the collection after it is initialized from config files.
        //protected override void SetReadOnly()
        //{
        //}

        //Custom configuration to hold the Input File Format Path
        [ConfigurationProperty("InputFileFormat", DefaultValue = @"INPUT", IsRequired = true)]
        public string InputFileFormat
        {
            get { return (string)this["InputFileFormat"]; }
            set { this["InputFileFormat"] = value; }
        }

        //Custom configuration to hold the value for IsMissing
        [ConfigurationProperty("ISMissing", DefaultValue = @"True", IsRequired = true)]
        public bool IsMissing
        {
            get { return (bool)this["ISMissing"]; }
            set { this["ISMissing"] = value; }
        }

        //Custom configuration to hold the Upload Folder Path
        [ConfigurationProperty("MissingSSN", DefaultValue = @"555555555", IsRequired = true)]
        public string MissingSSN
        {
            get { return (string)this["MissingSSN"]; }
            set { this["MissingSSN"] = value; }
        }

        //Custom configuration to hold the value of ISError
        [ConfigurationProperty("ISError", DefaultValue = @"True", IsRequired = true)]
        public bool ISError
        {
            get { return (bool)this["ISError"]; }
            set { this["ISError"] = value; }
        }

        //Custom configuration to hold the ErrorSSN to be considerd as error
        [ConfigurationProperty("ErrorSSN", DefaultValue = @"000000000", IsRequired = true)]
        public string ErrorSSN
        {
            get { return (string)this["ErrorSSN"]; }
            set { this["ErrorSSN"] = value; }
        }

        //Custom configuration to hold the Canned report Path
        [ConfigurationProperty("CannedSuccessFilePath", DefaultValue = @"\CannedReports\TU.CANNED.SUCCESS.pgp", IsRequired = true)]
        public string CannedSuccessFilePath
        {
            get { return (string)this["CannedSuccessFilePath"]; }
            set { this["CannedSuccessFilePath"] = value; }
        }

        //Custom configuration to hold the Canned report Path
        [ConfigurationProperty("CannedErrorFilePath", DefaultValue = @"\CannedReports\TU.CANNED.ERROR.pgp", IsRequired = true)]
        public string CannedErrorFilePath
        {
            get { return (string)this["CannedErrorFilePath"]; }
            set { this["CannedErrorFilePath"] = value; }
        }
    }    

Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA

AnswerRe: Custom Configuration section Pin
GenJerDan11-Jul-11 6:11
GenJerDan11-Jul-11 6:11 
GeneralRe: Custom Configuration section Pin
indian14311-Jul-11 6:25
indian14311-Jul-11 6:25 
GeneralRe: Custom Configuration section Pin
GenJerDan11-Jul-11 6:31
GenJerDan11-Jul-11 6:31 
GeneralRe: Custom Configuration section Pin
indian14311-Jul-11 6:57
indian14311-Jul-11 6:57 
GeneralRe: Custom Configuration section Pin
GenJerDan11-Jul-11 7:14
GenJerDan11-Jul-11 7:14 
AnswerRe: Custom Configuration section Pin
Shameel11-Jul-11 21:41
professionalShameel11-Jul-11 21:41 
Questionsms application Pin
shawn41411-Jul-11 0:17
shawn41411-Jul-11 0:17 
AnswerRe: sms application Pin
DaveAuld11-Jul-11 0:24
professionalDaveAuld11-Jul-11 0:24 
AnswerRe: sms application Pin
Shameel11-Jul-11 2:34
professionalShameel11-Jul-11 2:34 
Questionread file base64 and show on the image Pin
apadana_198910-Jul-11 20:14
apadana_198910-Jul-11 20:14 
AnswerRe: read file base64 and show on the image Pin
Joris Janssens11-Jul-11 7:59
professionalJoris Janssens11-Jul-11 7:59 
AnswerRe: read file base64 and show on the image Pin
Joris Janssens12-Jul-11 1:03
professionalJoris Janssens12-Jul-11 1:03 
Questiongridview can go last page index? Pin
buffering839-Jul-11 23:35
buffering839-Jul-11 23:35 
AnswerRe: gridview can go last page index? Pin
Viral Upadhyay10-Jul-11 17:56
Viral Upadhyay10-Jul-11 17:56 
Questioncreate html file on the server side Pin
apadana_19899-Jul-11 20:28
apadana_19899-Jul-11 20:28 
AnswerRe: create html file on the server side Pin
Shahriar Iqbal Chowdhury/Galib10-Jul-11 4:06
professionalShahriar Iqbal Chowdhury/Galib10-Jul-11 4:06 
AnswerRe: create html file on the server side Pin
Not Active10-Jul-11 5:42
mentorNot Active10-Jul-11 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.