Skip to content

Commit e36a02f

Browse files
committed
Now application deployed using ClickOnce will use Publish Version as the Application Version. This resolves #11.
1 parent 3c79824 commit e36a02f

16 files changed

Lines changed: 170 additions & 127 deletions

CrashReporter.NET.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Global
1515
Release|Any CPU = Release|Any CPU
1616
EndGlobalSection
1717
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18-
{67912BDA-1572-46B0-8623-5872D9DADBC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19-
{67912BDA-1572-46B0-8623-5872D9DADBC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{67912BDA-1572-46B0-8623-5872D9DADBC8}.Debug|Any CPU.ActiveCfg = Debug-NET40|Any CPU
19+
{67912BDA-1572-46B0-8623-5872D9DADBC8}.Debug|Any CPU.Build.0 = Debug-NET40|Any CPU
2020
{67912BDA-1572-46B0-8623-5872D9DADBC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
2121
{67912BDA-1572-46B0-8623-5872D9DADBC8}.Release|Any CPU.Build.0 = Release|Any CPU
2222
{895AE503-6920-4BFF-9D47-3A91F90E8606}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -31,6 +31,9 @@ Global
3131
GlobalSection(SolutionProperties) = preSolution
3232
HideSolutionNode = FALSE
3333
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {F4BDF3BA-3ADC-49E3-8B21-7179CB6D5250}
36+
EndGlobalSection
3437
GlobalSection(SubversionScc) = preSolution
3538
Svn-Managed = True
3639
Manager = AnkhSVN - Subversion Support for Visual Studio

CrashReporter.NET/CrashReporter.NET.csproj

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,77 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>CrashReporterDotNET</RootNamespace>
1212
<AssemblyName>CrashReporter.NET</AssemblyName>
13-
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
1718
<DebugSymbols>true</DebugSymbols>
1819
<DebugType>full</DebugType>
1920
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\$(TargetFrameworkVersion)</OutputPath>
2121
<DefineConstants>DEBUG;TRACE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24-
<DocumentationFile>bin\Debug\$(TargetFrameworkVersion)\CrashReporter.NET.XML</DocumentationFile>
2524
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
2625
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PropertyGroup Condition="$(Configuration.Contains('Release'))">
2827
<DebugType>pdbonly</DebugType>
2928
<Optimize>true</Optimize>
30-
<OutputPath>build\lib\net20\</OutputPath>
3129
<DefineConstants>TRACE</DefineConstants>
3230
<ErrorReport>prompt</ErrorReport>
3331
<WarningLevel>4</WarningLevel>
34-
<DocumentationFile>build\lib\net20\CrashReporter.NET.XML</DocumentationFile>
3532
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
3633
</PropertyGroup>
34+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
35+
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
36+
<OutputPath>bin\Debug\net20</OutputPath>
37+
<DocumentationFile>bin\Debug\net20\CrashReporter.NET.XML</DocumentationFile>
38+
</PropertyGroup>
39+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
40+
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
41+
<OutputPath>build\lib\net20</OutputPath>
42+
<DocumentationFile>build\lib\net20\CrashReporter.NET.XML</DocumentationFile>
43+
</PropertyGroup>
44+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug-NET35' ">
45+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
46+
<OutputPath>bin\Debug\net35</OutputPath>
47+
<DocumentationFile>bin\Debug\net35\CrashReporter.NET.XML</DocumentationFile>
48+
</PropertyGroup>
49+
<PropertyGroup Condition=" '$(Configuration)' == 'Release-NET35' ">
50+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
51+
<OutputPath>build\lib\net35</OutputPath>
52+
<DocumentationFile>build\lib\net35\CrashReporter.NET.XML</DocumentationFile>
53+
</PropertyGroup>
54+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug-NET40' ">
55+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
56+
<OutputPath>bin\Debug\net40</OutputPath>
57+
<DocumentationFile>bin\Debug\net40\CrashReporter.NET.XML</DocumentationFile>
58+
</PropertyGroup>
59+
<PropertyGroup Condition=" '$(Configuration)' == 'Release-NET40' ">
60+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
61+
<OutputPath>build\lib\net40</OutputPath>
62+
<DocumentationFile>build\lib\net40\CrashReporter.NET.XML</DocumentationFile>
63+
</PropertyGroup>
64+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug-NET452' ">
65+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
66+
<OutputPath>bin\Debug\net452</OutputPath>
67+
<DocumentationFile>bin\Debug\net452\CrashReporter.NET.XML</DocumentationFile>
68+
</PropertyGroup>
69+
<PropertyGroup Condition=" '$(Configuration)' == 'Release-NET452' ">
70+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
71+
<OutputPath>build\lib\net452</OutputPath>
72+
<DocumentationFile>build\lib\net452\CrashReporter.NET.XML</DocumentationFile>
73+
</PropertyGroup>
74+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug-NET462' ">
75+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
76+
<OutputPath>bin\Debug\net462</OutputPath>
77+
<DocumentationFile>bin\Debug\net462\CrashReporter.NET.XML</DocumentationFile>
78+
</PropertyGroup>
79+
<PropertyGroup Condition=" '$(Configuration)' == 'Release-NET462' ">
80+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
81+
<OutputPath>build\lib\net462</OutputPath>
82+
<DocumentationFile>build\lib\net462\CrashReporter.NET.XML</DocumentationFile>
83+
</PropertyGroup>
3784
<PropertyGroup>
3885
<SignAssembly>true</SignAssembly>
3986
</PropertyGroup>
@@ -43,6 +90,7 @@
4390
<ItemGroup>
4491
<Reference Include="System" />
4592
<Reference Include="System.Data" />
93+
<Reference Include="System.Deployment" />
4694
<Reference Include="System.Drawing" />
4795
<Reference Include="System.EnterpriseServices" />
4896
<Reference Include="System.Web" />

CrashReporter.NET/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CrashReporter.NET/Properties/Settings.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CrashReporter.NET/ReportCrash.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Deployment.Application;
23
using System.Diagnostics;
34
using System.Drawing.Imaging;
45
using System.IO;
@@ -119,8 +120,7 @@ public void Send(Exception exception)
119120
appTitle = ((AssemblyTitleAttribute) attributes[0]).Title;
120121
}
121122
ApplicationTitle = !string.IsNullOrEmpty(appTitle) ? appTitle : mainAssembly.GetName().Name;
122-
ApplicationVersion = mainAssembly.GetName().Version.ToString();
123-
123+
ApplicationVersion = ApplicationDeployment.IsNetworkDeployed ? ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString() : mainAssembly.GetName().Version.ToString();
124124
try
125125
{
126126
ScreenShot = $@"{Path.GetTempPath()}\{ApplicationTitle} Crash Screenshot.png";

CrashReporter.NET/Web References/com.drdump/Reference.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version:4.0.30319.18449
4+
// Runtime Version:4.0.30319.42000
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

1111
//
12-
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.18449.
12+
// This source code was auto-generated by Microsoft.VSDesigner, Version 4.0.30319.42000.
1313
//
1414
#pragma warning disable 1591
1515

@@ -23,7 +23,7 @@ namespace CrashReporterDotNET.com.drdump {
2323

2424

2525
/// <remarks/>
26-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")]
26+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3056.0")]
2727
[System.Diagnostics.DebuggerStepThroughAttribute()]
2828
[System.ComponentModel.DesignerCategoryAttribute("code")]
2929
[System.Web.Services.WebServiceBindingAttribute(Name="HttpCrashReporterReportUploader", Namespace="https://www.drdump.com/services")]
@@ -167,7 +167,7 @@ private bool IsLocalFileSystemWebService(string url) {
167167

168168
/// <remarks/>
169169
// CODEGEN: The optional WSDL extension element 'PolicyReference' from namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy' was not handled.
170-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")]
170+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3056.0")]
171171
[System.Diagnostics.DebuggerStepThroughAttribute()]
172172
[System.ComponentModel.DesignerCategoryAttribute("code")]
173173
[System.Web.Services.WebServiceBindingAttribute(Name="HttpsCrashReporterReportUploader", Namespace="https://www.drdump.com/services")]
@@ -310,7 +310,7 @@ private bool IsLocalFileSystemWebService(string url) {
310310
}
311311

312312
/// <remarks/>
313-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
313+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
314314
[System.SerializableAttribute()]
315315
[System.Diagnostics.DebuggerStepThroughAttribute()]
316316
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -367,7 +367,7 @@ public ushort V4 {
367367
}
368368

369369
/// <remarks/>
370-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
370+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
371371
[System.SerializableAttribute()]
372372
[System.Diagnostics.DebuggerStepThroughAttribute()]
373373
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -441,7 +441,7 @@ public string UserEmail {
441441
}
442442

443443
/// <remarks/>
444-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
444+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
445445
[System.SerializableAttribute()]
446446
[System.Diagnostics.DebuggerStepThroughAttribute()]
447447
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -526,7 +526,7 @@ public int PCID {
526526
}
527527

528528
/// <remarks/>
529-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
529+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
530530
[System.SerializableAttribute()]
531531
[System.Diagnostics.DebuggerStepThroughAttribute()]
532532
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -615,7 +615,7 @@ public string Type {
615615
[System.Xml.Serialization.XmlIncludeAttribute(typeof(StopResponse))]
616616
[System.Xml.Serialization.XmlIncludeAttribute(typeof(NeedReportResponse))]
617617
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ErrorResponse))]
618-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
618+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
619619
[System.SerializableAttribute()]
620620
[System.Diagnostics.DebuggerStepThroughAttribute()]
621621
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -751,7 +751,7 @@ public string UrlToProblem {
751751
}
752752

753753
/// <remarks/>
754-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
754+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
755755
[System.SerializableAttribute()]
756756
[System.Diagnostics.DebuggerStepThroughAttribute()]
757757
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -760,7 +760,7 @@ public partial class StopResponse : Response {
760760
}
761761

762762
/// <remarks/>
763-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
763+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
764764
[System.SerializableAttribute()]
765765
[System.Diagnostics.DebuggerStepThroughAttribute()]
766766
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -769,7 +769,7 @@ public partial class NeedReportResponse : Response {
769769
}
770770

771771
/// <remarks/>
772-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
772+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
773773
[System.SerializableAttribute()]
774774
[System.Diagnostics.DebuggerStepThroughAttribute()]
775775
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -791,7 +791,7 @@ public string Error {
791791
}
792792

793793
/// <remarks/>
794-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
794+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.3056.0")]
795795
[System.SerializableAttribute()]
796796
[System.Diagnostics.DebuggerStepThroughAttribute()]
797797
[System.ComponentModel.DesignerCategoryAttribute("code")]
@@ -913,11 +913,11 @@ public ushort V4 {
913913
}
914914

915915
/// <remarks/>
916-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")]
916+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3056.0")]
917917
public delegate void SendAnonymousReportCompletedEventHandler(object sender, SendAnonymousReportCompletedEventArgs e);
918918

919919
/// <remarks/>
920-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")]
920+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3056.0")]
921921
[System.Diagnostics.DebuggerStepThroughAttribute()]
922922
[System.ComponentModel.DesignerCategoryAttribute("code")]
923923
public partial class SendAnonymousReportCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
@@ -939,11 +939,11 @@ public Response Result {
939939
}
940940

941941
/// <remarks/>
942-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")]
942+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3056.0")]
943943
public delegate void SendAdditionalDataCompletedEventHandler(object sender, SendAdditionalDataCompletedEventArgs e);
944944

945945
/// <remarks/>
946-
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.18408")]
946+
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3056.0")]
947947
[System.Diagnostics.DebuggerStepThroughAttribute()]
948948
[System.ComponentModel.DesignerCategoryAttribute("code")]
949949
public partial class SendAdditionalDataCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {

CrashReporter.NET/app.config

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<configSections>
4-
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5-
<section name="CrashReporterDotNET.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
4+
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
5+
<section name="CrashReporterDotNET.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
66
</sectionGroup>
77
</configSections>
88
<applicationSettings>
99
<CrashReporterDotNET.Properties.Settings>
10-
<setting name="CrashReporter_NET_com_drdump_CrashReporterReportUploader"
11-
serializeAs="String">
10+
<setting name="CrashReporter_NET_com_drdump_CrashReporterReportUploader" serializeAs="String">
1211
<value>http://drdump.com/Service/CrashReporterReportUploader.svc</value>
1312
</setting>
1413
</CrashReporterDotNET.Properties.Settings>
1514
</applicationSettings>
16-
</configuration>
15+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

CrashReporterTest/CrashReporterTest.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
55
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@@ -10,8 +10,9 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>CrashReporterTest</RootNamespace>
1212
<AssemblyName>CrashReporterTest</AssemblyName>
13-
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
13+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
15+
<TargetFrameworkProfile />
1516
</PropertyGroup>
1617
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1718
<DebugSymbols>true</DebugSymbols>
@@ -21,6 +22,7 @@
2122
<PlatformTarget>AnyCPU</PlatformTarget>
2223
<ErrorReport>prompt</ErrorReport>
2324
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
25+
<Prefer32Bit>false</Prefer32Bit>
2426
</PropertyGroup>
2527
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
2628
<OutputPath>bin\Release\</OutputPath>
@@ -30,6 +32,7 @@
3032
<PlatformTarget>AnyCPU</PlatformTarget>
3133
<ErrorReport>prompt</ErrorReport>
3234
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
35+
<Prefer32Bit>false</Prefer32Bit>
3336
</PropertyGroup>
3437
<PropertyGroup>
3538
<SignAssembly>true</SignAssembly>
@@ -62,7 +65,9 @@
6265
<Compile Include="Properties\Resources.Designer.cs">
6366
<AutoGen>True</AutoGen>
6467
<DependentUpon>Resources.resx</DependentUpon>
68+
<DesignTime>True</DesignTime>
6569
</Compile>
70+
<None Include="app.config" />
6671
<None Include="app.manifest" />
6772
<None Include="Properties\Settings.settings">
6873
<Generator>SettingsSingleFileGenerator</Generator>

0 commit comments

Comments
 (0)