forked from MoonsideGames/MoonWorks
csproj tweaks to support app publish
parent
300ef9f88e
commit
adeba633e5
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net7.0</TargetFrameworks>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>11</LangVersion>
|
||||
|
@ -22,6 +22,7 @@
|
|||
<ItemGroup>
|
||||
<None Include="MoonWorks.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -97,16 +97,12 @@ namespace MoonWorks
|
|||
|
||||
// Get the path to the assembly
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
string assemblyPath = "";
|
||||
if (assembly.Location != null)
|
||||
{
|
||||
assemblyPath = Path.GetDirectoryName(assembly.Location);
|
||||
}
|
||||
string assemblyPath = System.AppContext.BaseDirectory;
|
||||
|
||||
// Locate the config file
|
||||
string xmlPath = Path.Combine(
|
||||
assemblyPath,
|
||||
assembly.GetName().Name + ".dll.config"
|
||||
"MoonWorks.dll.config"
|
||||
);
|
||||
if (!File.Exists(xmlPath))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue