| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFramework>net48</TargetFramework>
- <Nullable>disable</Nullable>
- <UseWPF>true</UseWPF>
- <Platforms>x64</Platforms>
- <PlatformTarget>x64</PlatformTarget>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
- <RootNamespace>Plugins.Vm</RootNamespace>
- <AssemblyName>Plugins.Vm</AssemblyName>
- </PropertyGroup>
- <!-- 海康 VisionMaster SDK 引用:VM 的托管 DLL 已随工程放在 VmSdk\ 目录(该目录下所有 *.dll 通配自动引用),
- 不依赖 VM 安装路径,工程自包含。Private=False:仅作编译期引用,运行时由本机已安装的 VM(4.4) 提供,
- 避免把 VM 程序集复制到输出与其安装环境冲突。 -->
- <PropertyGroup>
- <VmSdkRoot>$(MSBuildThisFileDirectory)VmSdk</VmSdkRoot>
- </PropertyGroup>
- <ItemGroup>
- <VmSdkDll Include="$(VmSdkRoot)\**\*.dll" />
- </ItemGroup>
- <ItemGroup>
- <PackageReference Include="OpenCvSharp4" Version="4.13.0.20260627" />
- <PackageReference Include="OpenCvSharp4.runtime.win" Version="4.13.0.20260627" />
- <PackageReference Include="PropertyGridLib" Version="1.2.0" />
- <PackageReference Include="System.Text.Json" Version="10.0.0" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="@(VmSdkDll->'%(FileName)')">
- <HintPath>%(VmSdkDll.Identity)</HintPath>
- <Private>False</Private>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\TeamAAS.Core\TeamAAS.Core\TeamAAS.Core.csproj" />
- </ItemGroup>
- <Target Name="CopyPluginDll" AfterTargets="Build" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
- <PropertyGroup>
- <PluginDir>$(MSBuildThisFileDirectory)..\..\EXE\win-x64\Plugins\</PluginDir>
- </PropertyGroup>
- <MakeDir Directories="$(PluginDir)" Condition="!Exists('$(PluginDir)')" />
- <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PluginDir)" SkipUnchangedFiles="true" />
- </Target>
- <!-- 把 VM SDK 的 DLL 同步到运行目录 Runtime\Vm4.4\(对应 Cognex 的 Runtime\Vpp9.0\);
- 运行时由 App.xaml.cs 的 CurrentDomain_AssemblyResolve 递归搜 Runtime\ 自动加载,避免手动拷贝漂移。 -->
- <Target Name="CopyVmSdkToRuntime" AfterTargets="Build" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
- <PropertyGroup>
- <VmRuntimeDir>$(MSBuildThisFileDirectory)..\..\EXE\win-x64\Runtime\Vm4.4\</VmRuntimeDir>
- </PropertyGroup>
- <MakeDir Directories="$(VmRuntimeDir)" Condition="!Exists('$(VmRuntimeDir)')" />
- <Copy SourceFiles="@(VmSdkDll)" DestinationFolder="$(VmRuntimeDir)" SkipUnchangedFiles="true" />
- </Target>
- </Project>
|