mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
removing app.config and web.config and putting in code
starting support for mysql (for linux)
This commit is contained in:
@ -16,7 +16,19 @@ namespace WebfrontCore
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false)
|
||||
.AddEnvironmentVariables();
|
||||
|
||||
|
||||
Configuration = builder.Build();
|
||||
// fixme: this is really really terrible
|
||||
if (!SharedLibrary.Utilities.IsRunningOnMono())
|
||||
{
|
||||
SharedLibrary.Database.DatabaseContext.ConnectionString = Configuration["ConnectionStrings:WindowsConnection"];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
SharedLibrary.Database.DatabaseContext.ConnectionString = Configuration["ConnectionStrings:LinuxConnection"];
|
||||
}
|
||||
|
||||
if (!IW4MAdmin.Program.Start())
|
||||
Environment.Exit(-1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<h3 class="pb-2 text-center ">@ViewBag.Title</h3>
|
||||
<h4 class="pb-2 text-center ">@ViewBag.Title</h4>
|
||||
<div class="row">
|
||||
<table class="table table-striped">
|
||||
<thead class="d-none d-md-table-header-group">
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net452</TargetFramework>
|
||||
@ -33,7 +33,6 @@
|
||||
<Content Remove="bower.json" />
|
||||
<Content Remove="bundleconfig.json" />
|
||||
<Content Remove="compilerconfig.json" />
|
||||
<Content Remove="web.config" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -77,7 +76,6 @@
|
||||
<None Include="bower.json" />
|
||||
<None Include="bundleconfig.json" />
|
||||
<None Include="compilerconfig.json" />
|
||||
<None Include="web.config" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -96,7 +94,11 @@
|
||||
<Folder Include="Views\Account\" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="if not "$(SolutionDir)"=="*Undefined*" (
 xcopy /Y "$(SolutionDir)BUILD\Plugins" "$(TargetDir)Plugins\"
)" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent Condition=" '$(OS)' != 'Unix' ">if not exist "$(ProjectDir)LibSQLCE\x86" md "$(TargetDir)x86" xcopy /y "$(ProjectDir)LibSQLCE\x86" "$(TargetDir)x86\"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent Condition=" '$(OS)' != 'Unix' ">if not exist "$(SolutionDir)BUILD" mkdir "$(SolutionDir)BUILD" if not exist "$(SolutionDir)BUILD\userraw\scripts" mkdir "$(SolutionDir)BUILD\userraw\scripts"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,37 +0,0 @@
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
|
||||
</startup>
|
||||
<runtime>
|
||||
<loadFromRemoteSources enabled="true"/>
|
||||
<assemblyBinding>
|
||||
<!-- <probing privatePath="lib"/>-->
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
|
||||
<parameters>
|
||||
<parameter value="System.Data.SqlServerCe.4.0" />
|
||||
</parameters>
|
||||
</defaultConnectionFactory>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="System.Data.SqlServerCe.4.0" />
|
||||
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<connectionStrings>
|
||||
<add name="DefaultConnection"
|
||||
providerName="System.Data.SqlServerCe.4.0"
|
||||
connectionString="Data Source=|DataDirectory|\Database.sdf"/>
|
||||
</connectionStrings>
|
||||
</configuration>
|
@ -9,5 +9,9 @@
|
||||
},
|
||||
"Web": {
|
||||
"Address": "http://127.0.0.1:5000"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"WindowsConnection": "Data Source=|DataDirectory|\\Database.sdf",
|
||||
"LinuxConnection": "server=server;user=user;database=db;password=pass"
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
|
||||
<!--
|
||||
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
|
||||
-->
|
||||
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
|
||||
</handlers>
|
||||
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
|
||||
</system.webServer>
|
||||
</configuration>
|
Reference in New Issue
Block a user