增加发布的bat,使用相对路径

master
Cal 2024-12-06 10:51:22 +08:00
parent 1fd4cf859b
commit b63ad0aed0
4 changed files with 16 additions and 7 deletions

View File

@ -1,10 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>.net8</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>true</ImplicitUsings>
<OutputPath>../bin</OutputPath>
</PropertyGroup>
<ItemGroup>
<Content Include="..\bin\net8.0\FileUtilsCs.dll">
<Link>FileUtilsCs.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@ -20,18 +20,18 @@ unsafe
(char*)Unsafe.AsPointer(ref Unsafe.AsRef(in "C:\\B".GetPinnableReference())));
Console.ReadKey();
[DllImport("E:\\Program\\AOTTools\\FileUtilsCs\\bin\\Debug\\net8.0\\win-x64\\native\\FileUtilsCs.dll", EntryPoint = "TestLog")]
[DllImport("FileUtilsCs.dll", EntryPoint = "TestLog")]
static extern void TestLog();
[DllImport("E:\\Program\\AOTTools\\FileUtilsCs\\bin\\Debug\\net8.0\\win-x64\\native\\FileUtilsCs.dll", EntryPoint = "SetLogInfo")]
[DllImport("FileUtilsCs.dll", EntryPoint = "SetLogInfo")]
static extern unsafe void SetLogInfo(delegate*<nint, void> logInfoFunc);
[DllImport("E:\\Program\\AOTTools\\FileUtilsCs\\bin\\Debug\\net8.0\\win-x64\\native\\FileUtilsCs.dll", EntryPoint = "SetLogError")]
[DllImport("FileUtilsCs.dll", EntryPoint = "SetLogError")]
static extern unsafe void SetLogError(delegate*<nint, void> logInfoFunc);
[DllImport("E:\\Program\\AOTTools\\FileUtilsCs\\bin\\Debug\\net8.0\\win-x64\\native\\FileUtilsCs.dll", EntryPoint = "TestLogError")]
[DllImport("FileUtilsCs.dll", EntryPoint = "TestLogError")]
static extern unsafe void TestLogError();
[DllImport("E:\\Program\\AOTTools\\FileUtilsCs\\bin\\Debug\\net8.0\\win-x64\\native\\FileUtilsCs.dll", EntryPoint = "Tick")]
[DllImport("FileUtilsCs.dll", EntryPoint = "Tick")]
static extern unsafe void Tick();
[DllImport("E:\\Program\\AOTTools\\FileUtilsCs\\bin\\Debug\\net8.0\\win-x64\\native\\FileUtilsCs.dll", EntryPoint = "MoveFolder")]
[DllImport("FileUtilsCs.dll", EntryPoint = "MoveFolder")]
static extern unsafe void MoveFolder(char* sourcePath, char* destinationPath);
static unsafe void LogInfo(nint obj)

View File

@ -6,6 +6,7 @@
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PublishAot>true</PublishAot>
<OutputPath>../bin</OutputPath>
</PropertyGroup>
</Project>

1
FileUtilsCs/publish.bat Normal file
View File

@ -0,0 +1 @@
dotnet publish -r win-x64 -c Debug -o ../bin