jj: License Module
This commit is contained in:
12
DDLicenseService/AppConfig.vb
Normal file
12
DDLicenseService/AppConfig.vb
Normal file
@@ -0,0 +1,12 @@
|
||||
Imports System.Configuration
|
||||
|
||||
Public Class AppConfig
|
||||
Public Shared ConfigPath As String
|
||||
|
||||
Public Shared Sub Load()
|
||||
With ConfigurationManager.AppSettings
|
||||
ConfigPath = .Item("CONFIG_PATH")
|
||||
End With
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>DDLicenseService.EDMWindowsService</StartupObject>
|
||||
<StartupObject>DDLicenseService.WindowsService</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -79,6 +79,7 @@
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppConfig.vb" />
|
||||
<Compile Include="ILicenseService.vb" />
|
||||
<Compile Include="LicenseService.vb" />
|
||||
<Compile Include="ProjectInstaller.vb">
|
||||
@@ -114,7 +115,7 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="App.config" />
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
|
||||
@@ -26,7 +26,7 @@ Public Class WindowsService
|
||||
|
||||
Protected Overrides Sub OnStart(ByVal args As String())
|
||||
Try
|
||||
_logConfig = New LogConfig(LogConfig.PathType.CustomPath, "E:\EDMService")
|
||||
_logConfig = New LogConfig(LogConfig.PathType.CustomPath, AppConfig.ConfigPath)
|
||||
_logger = _logConfig.GetLogger()
|
||||
|
||||
_logger.Info("Service {0} is starting", SERVICE_DISPLAY_NAME)
|
||||
|
||||
@@ -1,28 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<system.serviceModel>
|
||||
<behaviors>
|
||||
<serviceBehaviors>
|
||||
<behavior name="">
|
||||
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
|
||||
<serviceDebug includeExceptionDetailInFaults="false" />
|
||||
</behavior>
|
||||
</serviceBehaviors>
|
||||
</behaviors>
|
||||
<services>
|
||||
<service name="DDLicenseService.LicenseService">
|
||||
<endpoint address="" binding="basicHttpBinding" contract="DDLicenseService.ILicenseService">
|
||||
<identity>
|
||||
<dns value="localhost" />
|
||||
</identity>
|
||||
</endpoint>
|
||||
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
|
||||
<host>
|
||||
<baseAddresses>
|
||||
<add baseAddress="http://localhost:8733/Design_Time_Addresses/DDLicenseService/LicenseService/" />
|
||||
</baseAddresses>
|
||||
</host>
|
||||
</service>
|
||||
</services>
|
||||
</system.serviceModel>
|
||||
<appSettings>
|
||||
<add key="CONFIG_PATH" value="" />
|
||||
</appSettings>
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user