/
Server.csproj
61 lines (49 loc) · 2.77 KB
/
Server.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net48</TargetFrameworks>
<ApplicationManifest Condition="'$(TargetFramework)' == 'net48'">netfx.manifest</ApplicationManifest>
<EnableComHosting Condition="'$(TargetFramework)' == 'net7.0'">true</EnableComHosting>
<EnableRegFreeCom Condition="'$(TargetFramework)' == 'net7.0'">true</EnableRegFreeCom>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Contracts\IServer.cs" Link="IServer.cs" />
</ItemGroup>
<ItemGroup>
<ClientTfm Include="net7.0;net48" />
</ItemGroup>
<Target Name="ServerUsage_NetCore"
Condition="'$(NetFXServer)' != 'true' and '$(TargetFramework)' == 'net7.0'"
AfterTargets="Build">
<Message Importance="High" Text="%0a************************************%0a*** $(MSBuildProjectName) usage instructions ***%0a************************************" />
<Message Importance="High" Text="A RegFree COM manifest has been created for the server.%0aThe manifest '@(RegFreeComManifest->'%(Filename)%(Extension)')' must be included during server deployment.%0aThe Server project will copy all required outputs to the Client output directory." />
<ItemGroup>
<ServerOutput Include="$(OutputPath)/*.dll" />
<ServerOutput Include="$(OutputPath)/*.runtimeconfig.json" />
<ServerOutput Include="$(OutputPath)/*.deps.json" />
<ServerOutput Include="$(OutputPath)/*.manifest" />
</ItemGroup>
<!-- Deploy all required server outputs -->
<Copy SourceFiles="@(ServerOutput)"
DestinationFolder="../Client/$(BaseOutputPath)$(Configuration)/%(ClientTfm.Identity)/" />
</Target>
<Target Name="ServerUsage_NetFX"
Condition="'$(NetFXServer)' == 'true' and '$(TargetFramework)' == 'net482'"
AfterTargets="Build">
<Message Importance="High" Text="%0a************************************%0a*** $(MSBuildProjectName) usage instructions ***%0a************************************" />
<Message Importance="High" Text="The RegFree component manifest for a .NET Framework COM server is embeded as the application manifest. The manifest is not required to be available side-by-side on disk." />
<ItemGroup>
<ServerOutput Include="$(OutputPath)/*.dll" />
</ItemGroup>
<!-- Deploy all required server outputs -->
<Copy SourceFiles="@(ServerOutput)"
DestinationFolder="../Client/$(BaseOutputPath)$(Configuration)/%(ClientTfm.Identity)/" />
</Target>
<Target Name="Clean_RegFree"
AfterTargets="Clean">
<ItemGroup>
<ServerOutputToDelete Include="../Client/$(BaseOutputPath)$(Configuration)/%(ClientTfm.Identity)/Server.*" />
</ItemGroup>
<!-- Cleanup deployed server outputs -->
<Delete Files="@(ServerOutputToDelete)" />
</Target>
</Project>