Skip to content

Commit ee925cf

Browse files
committed
Fixes #5 and #12 - The portable library now builds as PCL and NET 4/5 and NuGet will pick up the correct one.
1 parent 4deb3de commit ee925cf

File tree

10 files changed

+75
-52
lines changed

10 files changed

+75
-52
lines changed

Libraries/Build.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
ForEach ($p in $client_projects) {
55
ForEach ($b in $client_build_configurations) {
66
$isPclClient = ($($p.Name) -eq "Exceptionless.Portable") -or ($($p.Name) -eq "Exceptionless.Portable.Signed")
7-
If (($isPclClient -and ($($b.NuGetDir) -ne "portable-net40+sl50+win+wpa81+wp80")) -or (!$isPclClient -and ($($b.NuGetDir) -eq "portable-net40+sl50+win+wpa81+wp80"))) {
7+
If (!$isPclClient -and ($($b.NuGetDir) -eq "portable-net40+sl50+win+wpa81+wp80")) {
88
Continue;
99
}
10-
10+
11+
$targetPortable = 'false';
12+
If ($isPclClient -and ($($b.NuGetDir) -eq "portable-net40+sl50+win+wpa81+wp80")) {
13+
$targetPortable = 'true';
14+
}
15+
1116
$outputDirectory = "$build_dir\$configuration\$($p.Name)\lib\$($b.NuGetDir)"
1217

1318
Write-Host "Building $($p.Name) ($($b.TargetFrameworkVersionProperty))" -ForegroundColor Yellow
@@ -23,6 +28,7 @@ ForEach ($p in $client_projects) {
2328
/verbosity:minimal `
2429
/p:DefineConstants="`"TRACE;SIGNED;$($b.Constants)`"" `
2530
/p:OutputPath="$outputDirectory" `
31+
/p:TargetPortable="$targetPortable" `
2632
/p:TargetFrameworkVersionProperty="$($b.TargetFrameworkVersionProperty)" `
2733
/t:"Rebuild"
2834
} else {
@@ -34,6 +40,7 @@ ForEach ($p in $client_projects) {
3440
/verbosity:minimal `
3541
/p:DefineConstants="`"TRACE;$($b.Constants)`"" `
3642
/p:OutputPath="$outputDirectory" `
43+
/p:TargetPortable="$targetPortable" `
3744
/p:TargetFrameworkVersionProperty="$($b.TargetFrameworkVersionProperty)" `
3845
/t:"Rebuild"
3946
}

Libraries/Package.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ForEach ($p in $client_projects) {
2020
#copy assemblies from build directory to working directory.
2121
ForEach ($b in $client_build_configurations) {
2222
$isPclClient = ($($p.Name) -eq "Exceptionless.Portable") -or ($($p.Name) -eq "Exceptionless.Portable.Signed")
23-
If (($isPclClient -and ($($b.NuGetDir) -ne "portable-net40+sl50+win+wpa81+wp80")) -or (!$isPclClient -and ($($b.NuGetDir) -eq "portable-net40+sl50+win+wpa81+wp80"))) {
23+
If (!$isPclClient -and ($($b.NuGetDir) -eq "portable-net40+sl50+win+wpa81+wp80")) {
2424
Continue;
2525
}
2626

Libraries/Settings.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $client_projects = @(
2929
)
3030

3131
$client_build_configurations = @(
32-
@{ Constants = "PORTABLE40"; TargetFrameworkVersionProperty="NET40"; NuGetDir = "portable-net40+sl50+win+wpa81+wp80"; }
33-
@{ Constants = "PORTABLE40"; TargetFrameworkVersionProperty="NET40"; NuGetDir = "net40"; },
34-
@{ Constants = "PORTABLE40"; TargetFrameworkVersionProperty="NET45"; NuGetDir = "net45"; }
32+
@{ Constants = "PORTABLE40"; TargetFrameworkVersionProperty="NET40"; NuGetDir = "portable-net40+sl50+win+wpa81+wp80"; }
33+
@{ Constants = "NET40"; TargetFrameworkVersionProperty="NET40"; NuGetDir = "net40"; },
34+
@{ Constants = ""; TargetFrameworkVersionProperty="NET45"; NuGetDir = "net45"; }
3535
)

Source/Extras/Exceptionless.Extras.csproj

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
1515
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET40' ">
17+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET45' ">
20+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
21+
</PropertyGroup>
1622
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1723
<DebugSymbols>true</DebugSymbols>
1824
<DebugType>full</DebugType>
@@ -31,12 +37,6 @@
3137
<WarningLevel>4</WarningLevel>
3238
<DocumentationFile>bin\Release\$(TargetFrameworkVersion)\Exceptionless.Extras.xml</DocumentationFile>
3339
</PropertyGroup>
34-
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET40' ">
35-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
36-
</PropertyGroup>
37-
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET45' ">
38-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
39-
</PropertyGroup>
4040
<ItemGroup>
4141
<Reference Include="Microsoft.VisualBasic" />
4242
<Reference Include="System" />
@@ -90,11 +90,4 @@
9090
<None Include="app.config" />
9191
</ItemGroup>
9292
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
93-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
94-
Other similar extension points exist, see Microsoft.Common.targets.
95-
<Target Name="BeforeBuild">
96-
</Target>
97-
<Target Name="AfterBuild">
98-
</Target>
99-
-->
10093
</Project>

Source/Platforms/Log4net/Exceptionless.Log4net.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET40' ">
17+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET45' ">
20+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
21+
</PropertyGroup>
1622
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1723
<DebugSymbols>true</DebugSymbols>
1824
<DebugType>full</DebugType>
@@ -65,11 +71,4 @@
6571
<None Include="packages.config" />
6672
</ItemGroup>
6773
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
68-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
69-
Other similar extension points exist, see Microsoft.Common.targets.
70-
<Target Name="BeforeBuild">
71-
</Target>
72-
<Target Name="AfterBuild">
73-
</Target>
74-
-->
7574
</Project>

Source/Platforms/NLog/Exceptionless.NLog.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET40' ">
17+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET45' ">
20+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
21+
</PropertyGroup>
1622
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1723
<DebugSymbols>true</DebugSymbols>
1824
<DebugType>full</DebugType>
@@ -68,11 +74,4 @@
6874
<None Include="packages.config" />
6975
</ItemGroup>
7076
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
71-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
72-
Other similar extension points exist, see Microsoft.Common.targets.
73-
<Target Name="BeforeBuild">
74-
</Target>
75-
<Target Name="AfterBuild">
76-
</Target>
77-
-->
7877
</Project>

Source/Platforms/WebApi/Exceptionless.WebApi.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<FileAlignment>512</FileAlignment>
1414
<TargetFrameworkProfile />
1515
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET40' ">
17+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET45' ">
20+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
21+
</PropertyGroup>
1622
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1723
<DebugSymbols>true</DebugSymbols>
1824
<DebugType>full</DebugType>
@@ -79,11 +85,4 @@
7985
<Content Include="NuGet\readme.txt" />
8086
</ItemGroup>
8187
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
82-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
83-
Other similar extension points exist, see Microsoft.Common.targets.
84-
<Target Name="BeforeBuild">
85-
</Target>
86-
<Target Name="AfterBuild">
87-
</Target>
88-
-->
8988
</Project>

Source/Shared/Exceptionless.Portable.csproj

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>Exceptionless</RootNamespace>
1212
<AssemblyName>Exceptionless.Portable</AssemblyName>
13-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14-
<TargetFrameworkProfile>Profile328</TargetFrameworkProfile>
13+
<TargetPortable Condition=" '$(TargetPortable)' == '' ">true</TargetPortable>
14+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1515
<FileAlignment>512</FileAlignment>
16-
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
1716
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(TargetPortable)' == 'true' ">
19+
<TargetFrameworkProfile>Profile328</TargetFrameworkProfile>
20+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET40' ">
23+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(TargetFrameworkVersionProperty)' == 'NET45' ">
26+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1827
</PropertyGroup>
1928
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2029
<DebugSymbols>true</DebugSymbols>
@@ -342,12 +351,21 @@
342351
<ItemGroup>
343352
<Content Include="NuGet\readme.txt" />
344353
</ItemGroup>
345-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
346-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
347-
Other similar extension points exist, see Microsoft.Common.targets.
348-
<Target Name="BeforeBuild">
349-
</Target>
350-
<Target Name="AfterBuild">
351-
</Target>
352-
-->
354+
<ItemGroup Condition=" '$(TargetPortable)' == 'false' ">
355+
<Reference Include="mscorlib" />
356+
<Reference Include="Microsoft.CSharp" />
357+
<Reference Include="System" />
358+
<Reference Include="System.Core" />
359+
<Reference Include="System.Data" />
360+
<Reference Include="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
361+
<SpecificVersion>False</SpecificVersion>
362+
<HintPath>..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll</HintPath>
363+
</Reference>
364+
<Reference Include="System.Numerics" />
365+
<Reference Include="System.Xml" />
366+
<Reference Include="System.Xml.Linq" />
367+
<Reference Include="System.Runtime.Serialization" />
368+
</ItemGroup>
369+
<Import Condition=" '$(TargetPortable)' == 'false' " Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
370+
<Import Condition=" '$(TargetPortable)' == 'true' " Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
353371
</Project>

Source/Shared/Polyfill/ConcurrentQueue.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System;
1+
#if PFX_LEGACY_3_5 || PORTABLE40
2+
3+
using System;
24
using System.Threading;
35
using System.Collections.Generic;
46

@@ -208,3 +210,5 @@ public bool IsEmpty {
208210
}
209211
}
210212
}
213+
214+
#endif

Source/Shared/Submission/DefaultSubmissionClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ private static string GetResponseMessage(HttpWebResponse response) {
9898
}
9999

100100
private HttpWebRequest CreateHttpWebRequest(ExceptionlessConfiguration config, string endPoint) {
101+
#if PORTABLE40
101102
var request = WebRequest.CreateHttp(String.Concat(config.GetServiceEndPoint(), endPoint));
103+
#else
104+
var request = (HttpWebRequest)WebRequest.Create(String.Concat(config.GetServiceEndPoint(), endPoint));
105+
#endif
102106
request.AddAuthorizationHeader(config);
103107
request.SetUserAgent(config);
104108
return request;

0 commit comments

Comments
 (0)