Skip to content

Commit 0bf1a85

Browse files
committed
fixed packages dependencies, added favicon.ico and added solution file
1 parent 09ffd6f commit 0bf1a85

File tree

6 files changed

+239
-10
lines changed

6 files changed

+239
-10
lines changed

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>

ExampleWebBasic.csproj

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
34
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
45
<PropertyGroup>
56
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -43,12 +44,16 @@
4344
<WarningLevel>4</WarningLevel>
4445
</PropertyGroup>
4546
<ItemGroup>
46-
<Reference Include="Desharp, Version=1.3.0.0, Culture=neutral, PublicKeyToken=cd60d985c52bcd6f, processorArchitecture=MSIL">
47-
<HintPath>..\packages\Desharp.1.3.0\lib\net40\Desharp.dll</HintPath>
47+
<Reference Include="Desharp, Version=1.3.0.2, Culture=neutral, processorArchitecture=MSIL">
48+
<HintPath>packages\Desharp.1.3.0.2\lib\net40\Desharp.dll</HintPath>
4849
<Private>True</Private>
4950
</Reference>
50-
<Reference Include="Desharp.Tests, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
51-
<HintPath>..\packages\Desharp.Tests.1.3.0\lib\net40\Desharp.Tests.dll</HintPath>
51+
<Reference Include="Desharp.Tests, Version=1.3.0.1, Culture=neutral, processorArchitecture=MSIL">
52+
<HintPath>packages\Desharp.Tests.1.3.0.1\lib\net45\Desharp.Tests.dll</HintPath>
53+
<Private>True</Private>
54+
</Reference>
55+
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
56+
<HintPath>packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
5257
<Private>True</Private>
5358
</Reference>
5459
<Reference Include="Microsoft.CSharp" />
@@ -59,13 +64,18 @@
5964
<Reference Include="System.Data.DataSetExtensions" />
6065
<Reference Include="System.Net.Http.WebRequest" />
6166
<Reference Include="System.Runtime.Serialization" />
67+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
68+
<HintPath>packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
69+
<Private>True</Private>
70+
</Reference>
6271
<Reference Include="System.Web" />
6372
<Reference Include="System.Web.Extensions" />
6473
</ItemGroup>
6574
<ItemGroup>
6675
<Content Include="custom-server-error-page.html" />
6776
<Content Include="Global.asax" />
6877
<Content Include="Index.aspx" />
78+
<Content Include="packages.config" />
6979
<Content Include="Web.config" />
7080
</ItemGroup>
7181
<ItemGroup>
@@ -75,7 +85,7 @@
7585
<Compile Include="Properties\AssemblyInfo.cs" />
7686
</ItemGroup>
7787
<ItemGroup>
78-
<Content Include="packages.config" />
88+
<Content Include="Desharp.config.example" />
7989
</ItemGroup>
8090
<PropertyGroup>
8191
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
@@ -102,6 +112,12 @@
102112
</FlavorProperties>
103113
</VisualStudio>
104114
</ProjectExtensions>
115+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
116+
<PropertyGroup>
117+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
118+
</PropertyGroup>
119+
<Error Condition="!Exists('packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
120+
</Target>
105121
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
106122
Other similar extension points exist, see Microsoft.Common.targets.
107123
<Target Name="BeforeBuild">

ExampleWebBasic.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}") = "ExampleWebBasic", "ExampleWebBasic.csproj", "{854409EF-4F06-4874-A3A5-6A630DE72475}"
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+
{854409EF-4F06-4874-A3A5-6A630DE72475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{854409EF-4F06-4874-A3A5-6A630DE72475}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{854409EF-4F06-4874-A3A5-6A630DE72475}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{854409EF-4F06-4874-A3A5-6A630DE72475}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

Web.config

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<add key="Desharp:Enabled" value="1"/>
2222
<add key="Desharp:Output" value="html"/>
2323
<!--add key="Desharp:DebugIps" value="127.0.0.1,::1" /-->
24-
<add key="Desharp:Levels" value="+exception,debug,info,-notice,-warning,+error,+critical,alert,+emergency,javascript"/>
24+
<add key="Desharp:Levels" value="exception,debug,info,-notice,-warning,error,critical,alert,emergency,javascript"/>
2525
<add key="Desharp:Panels" value="Desharp.Panels.SystemInfo,Desharp.Panels.Session"/>
2626
<add key="Desharp:Directory" value="~/Logs"/>
2727
<add key="Desharp:ErrorPage" value="~/custom-server-error-page.html"/>
@@ -44,7 +44,7 @@
4444
<remove name="UrlRoutingModule-4.0"/>
4545
<remove name="ScriptModule-4.0"/>
4646
<!-- https://docs.microsoft.com/en-us/iis/configuration/system.webserver/modules/add -->
47-
<add name="Desharp" type="Desharp.Module" preCondition="managedHandler"/>
47+
<add name="Desharp" type="Desharp.Module" preCondition="managedHandler" />
4848
</modules>
4949
<caching enabled="false" enableKernelCache="false"/>
5050
<directoryBrowse enabled="false"/>
@@ -81,5 +81,15 @@
8181
<runtime>
8282
<loadFromRemoteSources enabled="true"/>
8383
</runtime>
84+
<system.codedom>
85+
<compilers>
86+
<compiler language="c#;cs;csharp" extension=".cs"
87+
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
88+
warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
89+
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
90+
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
91+
warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
92+
</compilers>
93+
</system.codedom>
8494

8595
</configuration>

favicon.ico

44.1 KB
Binary file not shown.

packages.config

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Desharp" version="1.3.0" targetFramework="net45" />
4-
<package id="Desharp.Tests" version="1.3.0" targetFramework="net45" />
5-
<package id="Microsoft.CodeAnalysis" version="3.2.1" targetFramework="net45" />
3+
<package id="Desharp" version="1.3.0.2" targetFramework="net45" />
4+
<package id="Desharp.Tests" version="1.3.0.1" targetFramework="net45" />
5+
<package id="Microsoft.CodeAnalysis" version="3.3.1" targetFramework="net45" />
6+
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net45" />
7+
<package id="System.ValueTuple" version="4.5.0" targetFramework="net45" />
68
</packages>

0 commit comments

Comments
 (0)