Skip to content

Commit 0f81bb2

Browse files
authored
Merge pull request #2 from postsharp/feature/4.3/bug-14053
#14053 Upgrade PostSharp License server NuGet package on GitHub
2 parents 98d8c59 + 4486a30 commit 0f81bb2

File tree

7 files changed

+63
-40
lines changed

7 files changed

+63
-40
lines changed

src/PostSharp.LicenseServer/PostSharp.LicenseServer.csproj

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<IISExpressUseClassicPipelineMode />
2727
<TargetFrameworkProfile />
2828
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)..\..\packages\MSBuildTasks.1.4.0.88\tools</MSBuildCommunityTasksPath>
29+
<DontImportPostSharp>True</DontImportPostSharp>
2930
</PropertyGroup>
3031
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3132
<DebugSymbols>true</DebugSymbols>
@@ -68,17 +69,17 @@
6869
<Prefer32Bit>false</Prefer32Bit>
6970
</PropertyGroup>
7071
<ItemGroup>
71-
<Reference Include="PostSharp, Version=4.2.9.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
72-
<SpecificVersion>False</SpecificVersion>
73-
<HintPath>..\..\packages\PostSharp.4.2.9-preview\lib\net35-client\PostSharp.dll</HintPath>
72+
<Reference Include="PostSharp, Version=4.3.25.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
73+
<HintPath>..\..\packages\PostSharp.4.3.25\lib\net35-client\PostSharp.dll</HintPath>
74+
<Private>True</Private>
7475
</Reference>
75-
<Reference Include="PostSharp.Compiler.Common, Version=4.2.9.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
76-
<SpecificVersion>False</SpecificVersion>
77-
<HintPath>..\..\packages\PostSharp.Compiler.Common.4.2.9-preview\lib\net40\PostSharp.Compiler.Common.dll</HintPath>
76+
<Reference Include="PostSharp.Compiler.Common, Version=4.3.25.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
77+
<HintPath>..\..\packages\PostSharp.Compiler.Common.4.3.25\lib\net40\PostSharp.Compiler.Common.dll</HintPath>
78+
<Private>True</Private>
7879
</Reference>
79-
<Reference Include="PostSharp.Compiler.Settings, Version=4.2.9.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
80-
<SpecificVersion>False</SpecificVersion>
81-
<HintPath>..\..\packages\PostSharp.Compiler.Settings.4.2.9-preview\lib\net40\PostSharp.Compiler.Settings.dll</HintPath>
80+
<Reference Include="PostSharp.Compiler.Settings, Version=4.3.25.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
81+
<HintPath>..\..\packages\PostSharp.Compiler.Settings.4.3.25\lib\net40\PostSharp.Compiler.Settings.dll</HintPath>
82+
<Private>True</Private>
8283
</Reference>
8384
<Reference Include="System" />
8485
<Reference Include="System.Data" />
@@ -241,7 +242,7 @@
241242
</PropertyGroup>
242243
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
243244
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" />
244-
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets"/>
245+
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
245246
<ProjectExtensions>
246247
<VisualStudio>
247248
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
@@ -252,7 +253,7 @@
252253
</VisualStudio>
253254
</ProjectExtensions>
254255
<Target Name="VerifyDependencies">
255-
<Error Text="Web Publishing extension is not present." Condition="'$(WebPublishTasksDir)'==''"/>
256+
<Error Text="Web Publishing extension is not present." Condition="'$(WebPublishTasksDir)'==''" />
256257
</Target>
257258
<Target Name="Zip" DependsOnTargets="VerifyDependencies;Package">
258259
<XmlUpdate XmlFileName="obj\$(Configuration)\Package\PackageTmp\web.config" XPath="/configuration/applicationSettings/PostSharp.LicenseServer.Properties.Settings/setting[@name='GracePeriodWarningDays']/value" Value="1" />
@@ -265,10 +266,15 @@
265266
<XmlUpdate XmlFileName="obj\$(Configuration)\Package\PackageTmp\web.config" XPath="/configuration/connectionStrings/add/@connectionString" Value="Data Source=localhost;Initial Catalog=SharpCraftersLicenseServer;Integrated Security=True" />
266267
<XmlUpdate XmlFileName="obj\$(Configuration)\Package\PackageTmp\web.config" XPath="/configuration/system.net/mailSettings/smtp/network/@host" Value="localhost" />
267268
<ItemGroup>
268-
<_ZipFiles Include="obj\$(Configuration)\Package\PackageTmp\**\*"/>
269+
<_ZipFiles Include="obj\$(Configuration)\Package\PackageTmp\**\*" />
269270
</ItemGroup>
270271
<Zip ZipFileName="$(OutputPath)PostSharp.LicenseServer.zip" Files="@(_ZipFiles)" WorkingDirectory="obj\$(Configuration)\Package\PackageTmp" />
271-
<Message Importance="High" Text="The license server release is ready in $(MSBuildThisFileDirectory)$(OutputPath)PostSharp.LicenseServer.zip."/>
272+
<Message Importance="High" Text="The license server release is ready in $(MSBuildThisFileDirectory)$(OutputPath)PostSharp.LicenseServer.zip." />
273+
</Target>
274+
<Import Project="..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets" Condition="Exists('..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets')" />
275+
<Target Name="EnsurePostSharpImported" BeforeTargets="BeforeBuild" Condition="'$(PostSharp30Imported)' == ''">
276+
<Error Condition="!Exists('..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://www.postsharp.net/links/nuget-restore." />
277+
<Error Condition="Exists('..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://www.postsharp.net/links/nuget-restore." />
272278
</Target>
273279
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
274280
Other similar extension points exist, see Microsoft.Common.targets.

src/PostSharp.LicenseServer/Web.config

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<configSections>
44
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
5-
<section name="PostSharp.LicenseServer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
5+
<section name="PostSharp.LicenseServer.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
66
</sectionGroup>
77
</configSections>
88
<!--
@@ -16,17 +16,17 @@
1616
<system.web>
1717
<compilation debug="true" targetFramework="4.5">
1818
<assemblies>
19-
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
19+
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
2020
</assemblies>
2121
</compilation>
22-
<authentication mode="Windows"/>
22+
<authentication mode="Windows" />
2323
<authorization>
2424
<!-- TODO: Configure security of the license service. Define which users are allowed to borrow a license. -->
2525
<!--
2626
<deny users="?" />
2727
-->
2828
</authorization>
29-
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
29+
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
3030
</system.web>
3131
<location path="Admin">
3232
<system.web>
@@ -42,7 +42,7 @@
4242
<location path="Documentation">
4343
<system.web>
4444
<authorization>
45-
<deny users="*"/>
45+
<deny users="*" />
4646
</authorization>
4747
</system.web>
4848
</location>
@@ -122,14 +122,22 @@
122122
</applicationSettings>
123123
<connectionStrings>
124124
<!-- TODO: Set the connection string to the license server -->
125-
<add name="SharpCrafters_LicenseServerConnectionString" connectionString="Data Source=mssql2.kpy.sharpcrafters.com;Initial Catalog=LicenseServer_Dev;Integrated Security=True" providerName="System.Data.SqlClient"/>
125+
<add name="SharpCrafters_LicenseServerConnectionString" connectionString="Data Source=mssql2.kpy.sharpcrafters.com;Initial Catalog=LicenseServer_Dev;Integrated Security=True" providerName="System.Data.SqlClient" />
126126
</connectionStrings>
127127
<system.net>
128128
<mailSettings>
129129
<smtp>
130130
<!-- TODO: Set the host to the SMTP server-->
131-
<network host="smtp.kpy.sharpcrafters.com"/>
131+
<network host="smtp.kpy.sharpcrafters.com" />
132132
</smtp>
133133
</mailSettings>
134134
</system.net>
135+
<runtime>
136+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
137+
<dependentAssembly>
138+
<assemblyIdentity name="PostSharp" publicKeyToken="b13fd38b8f9c99d7" culture="neutral" />
139+
<bindingRedirect oldVersion="0.0.0.0-4.3.25.0" newVersion="4.3.25.0" />
140+
</dependentAssembly>
141+
</assemblyBinding>
142+
</runtime>
135143
</configuration>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="MSBuildTasks" version="1.4.0.88" targetFramework="net45" />
4-
<package id="PostSharp" version="4.2.9-preview" targetFramework="net45" />
5-
<package id="PostSharp.Compiler.Common" version="4.2.9-preview" targetFramework="net45" />
6-
<package id="PostSharp.Compiler.Settings" version="4.2.9-preview" targetFramework="net45" />
4+
<package id="PostSharp" version="4.3.25" targetFramework="net45" />
5+
<package id="PostSharp.Compiler.Common" version="4.3.25" targetFramework="net45" />
6+
<package id="PostSharp.Compiler.Settings" version="4.3.25" targetFramework="net45" />
77
</packages>

test/PostSharp.LicenseServer.Test/ClientSimulator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.Win32;
55
using PostSharp.Sdk;
66
using PostSharp.Sdk.Extensibility.Licensing;
7+
using PostSharp.Sdk.Extensibility.Licensing.Helpers;
78

89
namespace SharpCrafters.LicenseServer.Test
910
{
@@ -78,7 +79,7 @@ public void Main()
7879
LicensedProduct.PostSharp30);
7980

8081
Stopwatch stopwatch = Stopwatch.StartNew();
81-
lease = UserLicenseManager.GetLease(url, registryKey, VirtualDateTime.UtcNow.ToLocalTime(), messageSink);
82+
lease = LicenseServerClient.TryGetLease( url, registryKey, VirtualDateTime.UtcNow.ToLocalTime(), messageSink );
8283

8384
if ( lease == null )
8485
{

test/PostSharp.LicenseServer.Test/PostSharp.LicenseServer.Test.csproj

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@
5151
<SkipPostSharp>True</SkipPostSharp>
5252
</PropertyGroup>
5353
<ItemGroup>
54-
<Reference Include="PostSharp, Version=4.2.9.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
55-
<SpecificVersion>False</SpecificVersion>
56-
<HintPath>..\..\packages\PostSharp.4.2.9-preview\lib\net35-client\PostSharp.dll</HintPath>
54+
<Reference Include="PostSharp, Version=4.3.25.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
55+
<HintPath>..\..\packages\PostSharp.4.3.25\lib\net35-client\PostSharp.dll</HintPath>
5756
<Private>True</Private>
5857
</Reference>
59-
<Reference Include="PostSharp.Compiler.Common, Version=4.2.9.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
60-
<SpecificVersion>False</SpecificVersion>
61-
<HintPath>..\..\packages\PostSharp.Compiler.Common.4.2.9-preview\lib\net40\PostSharp.Compiler.Common.dll</HintPath>
58+
<Reference Include="PostSharp.Compiler.Common, Version=4.3.25.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
59+
<HintPath>..\..\packages\PostSharp.Compiler.Common.4.3.25\lib\net40\PostSharp.Compiler.Common.dll</HintPath>
60+
<Private>True</Private>
6261
</Reference>
63-
<Reference Include="PostSharp.Compiler.Settings">
64-
<HintPath>..\..\packages\PostSharp.Compiler.Settings.4.2.9-preview\lib\net40\PostSharp.Compiler.Settings.dll</HintPath>
62+
<Reference Include="PostSharp.Compiler.Settings, Version=4.3.25.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7, processorArchitecture=MSIL">
63+
<HintPath>..\..\packages\PostSharp.Compiler.Common.4.3.25\lib\net40\PostSharp.Compiler.Settings.dll</HintPath>
6564
<Private>True</Private>
6665
</Reference>
6766
<Reference Include="System" />
@@ -91,10 +90,10 @@
9190
</ProjectReference>
9291
</ItemGroup>
9392
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
94-
<Import Project="..\..\packages\PostSharp.4.2.9-preview\tools\PostSharp.targets" Condition="Exists('..\..\packages\PostSharp.4.2.9-preview\tools\PostSharp.targets')" />
93+
<Import Project="..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets" Condition="Exists('..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets')" />
9594
<Target Name="EnsurePostSharpImported" BeforeTargets="BeforeBuild" Condition="'$(PostSharp30Imported)' == ''">
96-
<Error Condition="!Exists('..\..\packages\PostSharp.4.2.9-preview\tools\PostSharp.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://www.postsharp.net/links/nuget-restore." />
97-
<Error Condition="Exists('..\..\packages\PostSharp.4.2.9-preview\tools\PostSharp.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://www.postsharp.net/links/nuget-restore." />
95+
<Error Condition="!Exists('..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://www.postsharp.net/links/nuget-restore." />
96+
<Error Condition="Exists('..\..\packages\PostSharp.4.3.25\tools\PostSharp.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://www.postsharp.net/links/nuget-restore." />
9897
</Target>
9998
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
10099
Other similar extension points exist, see Microsoft.Common.targets.
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>
4+
<runtime>
5+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
6+
<dependentAssembly>
7+
<assemblyIdentity name="PostSharp" publicKeyToken="b13fd38b8f9c99d7" culture="neutral" />
8+
<bindingRedirect oldVersion="0.0.0.0-4.3.22.0" newVersion="4.3.22.0" />
9+
</dependentAssembly>
10+
</assemblyBinding>
11+
</runtime>
12+
</configuration>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="PostSharp" version="4.2.9-preview" targetFramework="net45" />
4-
<package id="PostSharp.Compiler.Common" version="4.2.9-preview" targetFramework="net45" />
3+
<package id="PostSharp" version="4.3.25" targetFramework="net45" />
4+
<package id="PostSharp.Compiler.Common" version="4.3.25" targetFramework="net45" />
55
<package id="PostSharp.Compiler.Settings" version="4.2.9-preview" targetFramework="net45" />
66
</packages>

0 commit comments

Comments
 (0)