Config xml file vb net




















Public Class SettingsConfig. Imports Contexts. Imports Microsoft. Imports Models. Namespace Contexts. Inherits DbContext. Public Sub New. End Sub. New options. If Not optionsBuilder. IsConfigured Then. ApplyConfiguration New ContactsConfiguration. OnModelCreatingPartial modelBuilder. End Namespace. AddJsonFile "appsettings. GetSection "database". NormalConfiguration optionsBuilder. UseSqlServer BuildConnection. LogTo AddressOf Console. AddInterceptors New CommandInterceptor.

Active 11 years ago. Viewed 41k times. Net 3. SettingElement In section. Name If name. Improve this question. Henk Holterman k 29 29 gold badges silver badges bronze badges. Phil M Phil M 11 1 1 gold badge 1 1 silver badge 2 2 bronze badges. Did you find a solution for this?

Add a comment. Active Oldest Votes. FirstName 'Persist values My. Improve this answer. Chris Haas Chris Haas Yeah, I might reconsider that. Might be the simplest way to manage. Thinking it over.. BUt how about if it's Application scope? How do we change its value without we re-run the app? Hans Passant Hans Passant k gold badges silver badges bronze badges. Fair enough.. I think it is ClickOnce that makes it hard.

Still, I want to have a separate custom. Read a. NET easily: ' ' Verify the configuration file exists. Exists aConfigPath Then Application. Exit End If ' ' Read the runtime versions. GetNamedItem "version". SelectSingleNode "requiredRuntime". Value; if aRequiredVersion!



0コメント

  • 1000 / 1000