Skip to content

Commit 416cfdd

Browse files
committed
solution file, new desharp release, fixed nuget packages dependencies
1 parent 76c56b5 commit 416cfdd

File tree

7 files changed

+221
-8
lines changed

7 files changed

+221
-8
lines changed

App.config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
4+
<appSettings>
5+
<add key="Desharp:SourceLocation" value="1"/>
6+
<add key="Desharp:Enabled" value="1"/>
7+
<add key="Desharp:Output" value="html"/>
8+
<add key="Desharp:Levels" value="exception,debug,info,-notice,-warning,error,critical,alert,emergency"/>
9+
<add key="Desharp:Directory" value="~/Logs"/>
10+
</appSettings>
11+
12+
</configuration>

Desharp.config.example

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
4+
<startup>
5+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
6+
</startup>
7+
8+
9+
<!-- For web applications only - add Desharp http module by: -->
10+
<system.webServer>
11+
<modules>
12+
<add name="Desharp" type="Desharp.Module" preCondition="managedHandler" />
13+
</modules>
14+
<httpErrors errorMode="Detailed" />
15+
</system.webServer>
16+
17+
18+
<appSettings>
19+
20+
<!--
21+
If `true`, all dumps by method `Debug.Dump()` are internally rendered and displayed.
22+
For web applications, there is debug panel is displayed in browser with dumped variables or rendered exceptions.
23+
For desktop applications, there is console priniting enabled or output debug window printing enabled.
24+
- Not required to configure, but very recomanded.
25+
- Possible values: `1`, `0`, `true`, `false`.
26+
- If not configured - enabled is only when VS debugger is attached or entry assembly is builded as Debug.
27+
- If disabled - all `Debug.Log()` calls are still enabled and executed, see more option `Desharp:Levels`.
28+
-->
29+
<add key="Desharp:Enabled" value="1" />
30+
31+
<!--
32+
Logs content format.
33+
- Not required, `text` by default.
34+
- Possible values: `html`, `text`.
35+
-->
36+
<add key="Desharp:Output" value="html" />
37+
38+
<!--
39+
Client IP adresses list to limit `Desharp` enabled state only for some clients.
40+
- Not required to configure, very recomanded for web applications.
41+
- Possible values: IPv4 or IPv6, separated by comma (IPv6 without `[]` brackets).
42+
- If not configured and `Desharp` is in enabled state, then `Desharp` is enabled for all clients.
43+
-->
44+
<add key="Desharp:DebugIps" value="127.0.0.1,::1" />
45+
46+
<!--
47+
Loggin levels to enable/disable to write on hard drive and also possibility to enable/disable email notifications.
48+
- Not required, recomanded.
49+
- Possible values: `exception`, `debug`, `info`, `notice`, `warning`, `error`, `critical`, `alert`, `emergency`, `javascript`.
50+
- If not configured, all logging levels are enabled for logging and not enabled for email notifications.
51+
- If at least one level is configured, then all other configured levels are disabled for logging and for email notifications.
52+
- If you want to enable any logging level - put the level name into node `value` attribute (comma separated).
53+
- If you want to disable any logging level - put minus (-) character before level name or remove level name.
54+
- If you want to enable any logging level for email notifications - put plus (+) character before level name.
55+
For any notification type with plus sign, it required to configure `Desharp:NotifySettings` property!
56+
-->
57+
<add key="Desharp:Levels" value="+exception,debug,info,-notice,-warning,+error,+critical,alert,+emergency,javascript" />
58+
59+
<!--
60+
Logged messages notifications by configured levels.
61+
- Not required, recomanded in production mode.
62+
- Possible values:
63+
- `host`: Required, mail server smtp domain | IPv4 | IPv6.
64+
- `port`: Not required, `25` by default.
65+
- `ssl`: Not required, `false` by default.
66+
- `from`: Required if no username and password specified, email address to specify sender, if no value specified, there is used `username` value.
67+
- `username` and `password`: Required if no `from` sender specified, mail server username/password credentials for sender account, always necessary to use together.
68+
- `domain` - Not required, no default value. Used only as third parametter for `System.Net.NetworkCredential` if presented.
69+
- `to`: Required, single recepient email adress or multiple adresses separated by semicolon `;`.
70+
- `priority`: Not required, possible values: `low` | `normal` | `high` (`normal` by defaut).
71+
- `timeout`: Not required, smtp server timeout specified in miliseconds, `10000` by default (10 seconds).
72+
- `background`: Not required at all. Default value is `true` to send all notifications in background thread.
73+
Use `false` value only to debug email sending.
74+
-->
75+
<add key="Desharp:NotifySettings" value="{
76+
host: 'smtp.company.com',
77+
port: 587,
78+
ssl: true,
79+
user: 'noreply@company.com',
80+
password: 'your-secret-password',
81+
from: 'noreply@company.com',
82+
to: 'your.name@gmail.com',
83+
priority: 'high',
84+
timeout: 30000
85+
}" />
86+
87+
<!--
88+
Web debug bar panels.
89+
- Not required, recomanded.
90+
- Full class names separated by comma `,`.
91+
- Panel class has to implement public interface: `Desharp.Panels.IPanel`
92+
- Panel class could implement interface: `Desharp.Panels.ISessionPanel`,
93+
where are method called when session is is read and written every request.
94+
- There are always enabled build-in panels for execution time, dumps and exceptions.
95+
- Build-in panels you can optionally use:
96+
- `Desharp.Panels.SystemInfo` - to display most important request info
97+
- `Desharp.Panels.Session` - to display basic session configuration and values
98+
- `Desharp.Panels.Routing` - to display matched MVC routes (still in TODO state)
99+
-->
100+
<add key="Desharp:Panels" value="Desharp.Panels.SystemInfo,Desharp.Panels.Session" />
101+
102+
<!--
103+
Absolute or relative path from application root directory.
104+
- Not required, recomanded.
105+
- Relative path from app root has to start with '~/' like: '~/Path/To/Logs'.
106+
- If not configured, all log files are written into application root directory.
107+
-->
108+
<add key="Desharp:Directory" value="~/Logs" />
109+
110+
<!--
111+
Always render source location from where dump has been called by `Debug.Dump()`.
112+
- Not required, recomanded.
113+
- Possible values: `1`, `0`, `true`, `false`.
114+
- If not configured, no dumps source locations are rendered in dump ouputs.
115+
-->
116+
<add key="Desharp:SourceLocation" value="1" />
117+
118+
<!--
119+
Milisecond timeout how often logged messages or exceptions are written from memory to hard drive.
120+
- Not required, recomanded for speed optimalization in production mode.
121+
- Possible values - use digits to define any miliseconds integer value.
122+
- If not configured, all messages or exceptions are written immediately
123+
in current thread, where is called `Desharp.Log()`.
124+
-->
125+
<add key="Desharp:WriteMiliseconds" value="5000" />
126+
127+
<!--
128+
.NET objects dumping depth.
129+
- Not required, recomanded for speed optimalization in production mode.
130+
- Possible values: just digit like `2`, `3`, `4` or `5`.
131+
- If not configured, `3` by default.
132+
-->
133+
<add key="Desharp:Depth" value="3" />
134+
135+
<!--
136+
Maximum length for dumped string values.
137+
- Not required, recomanded for speed optimalization in production mode.
138+
- Possible values: just digit like `512`, `1024` or `5000`...
139+
- If not configured, `1024` by default.
140+
-->
141+
<add key="Desharp:MaxLength" value="1024" />
142+
143+
<!--
144+
Custom web error page.
145+
- Not required, recomanded for production mode.
146+
- If `Desharp` is not enabled and there is uncaught exception in your application,
147+
you can use custom static error page to transfer into client browser.
148+
- If not configured - `Desharp` build-in error page is used by default with error 500.
149+
-->
150+
<add key="Desharp:ErrorPage" value="~/custom-error-page-500.html" />
151+
152+
<!--
153+
Dump all internal .NET events, properties ad fields in custom class instances,
154+
(created internally and usually for properties values )and all class instance
155+
member types marked with `System.Runtime.CompilerServices.CompillerGenerated`
156+
attribute or with `Desharp.Hidden` attribute.
157+
This option is usefull to see everything in memory.
158+
- Not required, recomanded only for deep development view.
159+
- Possible values: `1`, `0`, `true`, `false`.
160+
- If not configured, `false` by default.
161+
- If not configured or configured as `false`, you can hide
162+
your class members for dumping and logging by attributes:
163+
- [System.Runtime.CompilerServices.CompilerGenerated] - .NET standard.
164+
- [Desharp.Hidden] - shorter.
165+
-->
166+
<add key="Desharp:DumpCompillerGenerated" value="true" />
167+
168+
<!--
169+
Default editor param value.
170+
- Not required, marginal.
171+
- For automatic file opening in Visual Studio or in any other editor by rendered links:
172+
`<a href="editor://file=...&line=...&editor=MSVS2019">../File.cs:123</a>
173+
- Possible values: any string key to open your editor from html output by.
174+
- If not configured, value is automaticly detected by Visual Studio instalation on current system.
175+
-->
176+
<add key="Desharp:Editor" value="MSVS2019" />
177+
178+
</appSettings>
179+
</configuration>

ExampleWinForms.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35-
<Reference Include="Desharp, Version=1.3.0.0, Culture=neutral, PublicKeyToken=cd60d985c52bcd6f, processorArchitecture=MSIL">
36-
<HintPath>..\packages\Desharp.1.3.0\lib\net40\Desharp.dll</HintPath>
35+
<Reference Include="Desharp, Version=1.3.0.1, Culture=neutral, PublicKeyToken=cd60d985c52bcd6f, processorArchitecture=MSIL">
36+
<HintPath>packages\Desharp.1.3.0.1\lib\net40\Desharp.dll</HintPath>
3737
<Private>True</Private>
3838
</Reference>
3939
<Reference Include="System" />
@@ -42,7 +42,6 @@
4242
<Reference Include="Microsoft.CSharp" />
4343
<Reference Include="System.Data" />
4444
<Reference Include="System.Data.DataSetExtensions" />
45-
<Reference Include="System.Deployment" />
4645
<Reference Include="System.Drawing" />
4746
<Reference Include="System.Runtime.Serialization" />
4847
<Reference Include="System.Web" />
@@ -70,6 +69,8 @@
7069
<AutoGen>True</AutoGen>
7170
<DependentUpon>Resources.resx</DependentUpon>
7271
</Compile>
72+
<None Include="App.config" />
73+
<None Include="Desharp.config.example" />
7374
<None Include="packages.config" />
7475
<None Include="Properties\Settings.settings">
7576
<Generator>SettingsSingleFileGenerator</Generator>

ExampleWinForms.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleWinForms", "ExampleWinForms.csproj", "{2633EF41-3D49-45ED-8C59-FA5D8CFDC8B6}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{2633EF41-3D49-45ED-8C59-FA5D8CFDC8B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{2633EF41-3D49-45ED-8C59-FA5D8CFDC8B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{2633EF41-3D49-45ED-8C59-FA5D8CFDC8B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{2633EF41-3D49-45ED-8C59-FA5D8CFDC8B6}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

Form1.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ private void _demoDumpAndLog() {
3434
this.output.Text += Debug.Dump(demoObject, new DumpOptions {
3535
Return = true,
3636
SourceLocation = true
37-
});
38-
this.output.Text += Environment.NewLine + Environment.NewLine;
37+
}) + Environment.NewLine + Environment.NewLine;
3938

4039
Debug.Dump(demoObject);
4140
Debug.Log(demoObject);

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.3.0.0")]
36-
[assembly: AssemblyFileVersion("1.3.0.0")]
35+
[assembly: AssemblyVersion("1.3.0.1")]
36+
[assembly: AssemblyFileVersion("1.3.0.1")]

packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Desharp" version="1.3.0" targetFramework="net40" />
3+
<package id="Desharp" version="1.3.0.1" targetFramework="net40" />
44
</packages>

0 commit comments

Comments
 (0)