Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions csrc/mmdeploy/apis/csharp/MMDeploy.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MMDeploy", "MMDeploy\MMDeployCSharp.csproj", "{3DC914EB-A8FB-4A89-A7CF-7DF9CC5284A6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MMDeployCSharp", "MMDeploy\MMDeployCSharp.csproj", "{3DC914EB-A8FB-4A89-A7CF-7DF9CC5284A6}"
EndProject

Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -28,18 +27,6 @@ Global
{3DC914EB-A8FB-4A89-A7CF-7DF9CC5284A6}.Release|x64.Build.0 = Release|Any CPU
{3DC914EB-A8FB-4A89-A7CF-7DF9CC5284A6}.Release|x86.ActiveCfg = Release|Any CPU
{3DC914EB-A8FB-4A89-A7CF-7DF9CC5284A6}.Release|x86.Build.0 = Release|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Debug|x64.ActiveCfg = Debug|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Debug|x64.Build.0 = Debug|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Debug|x86.ActiveCfg = Debug|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Debug|x86.Build.0 = Debug|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Release|Any CPU.Build.0 = Release|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Release|x64.ActiveCfg = Release|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Release|x64.Build.0 = Release|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Release|x86.ActiveCfg = Release|Any CPU
{661A4295-68CF-41C6-85B8-B11748113A6F}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
19 changes: 18 additions & 1 deletion csrc/mmdeploy/apis/csharp/MMDeploy/MMDeployCSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net48;</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net48;net472;</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<AssemblyName>MMDeployCSharp</AssemblyName>
Expand All @@ -27,6 +27,20 @@
<Pack>true</Pack>
<PackagePath>build\net48\MMDeployCSharp.props</PackagePath>
</Content>
<Content Include="MMDeployCSharp.props">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>true</Pack>
<PackagePath>build\net472\MMDeployCSharp.props</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
<!-- 包含 targets -->
<None Include="build\net48\MMDeployCSharp.targets"
Pack="true"
PackagePath="build\net48\" />
<None Include="build\net48\MMDeployCSharp.targets"
Pack="true"
PackagePath="build\net472\" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -37,6 +51,9 @@
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3.1|x64'">
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
Expand Down
6 changes: 6 additions & 0 deletions csrc/mmdeploy/apis/csharp/MMDeploy/MMDeployCSharp.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<!-- 包含 targets -->
<None Include="build\net48\mmdeploy.targets"
Pack="true"
PackagePath="build\net48\" />
</ItemGroup>
</Project>
22 changes: 22 additions & 0 deletions csrc/mmdeploy/apis/csharp/MMDeploy/build/net48/mmdeploy.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
MSBuildThisFileDirectory 在消费端项目里会被解析为
packages\<YourPackage>.<version>\build\net48\
-->
<ItemGroup>
<!-- 定位到包中 runtimes\win-x64\native\mmdeploy.dll -->
<MMDeployNativeDll Include="$(MSBuildThisFileDirectory)..\runtimes\win-x64\native\mmdeploy.dll" />
</ItemGroup>

<!-- 在经典 .NET Framework 项目编译完成后复制到输出目录 -->
<Target Name="CopyMMDeployNative" AfterTargets="Build">
<Message Text="Copying mmdeploy.dll to $(OutputPath)" Importance="Low" />
<Copy
SourceFiles="@(MMDeployNativeDll)"
DestinationFolder="$(OutputPath)"
SkipUnchangedFiles="true" />
</Target>

</Project>