Skip to content

Commit d000e37

Browse files
committed
nuget packages dependencies fix, custom solution file
1 parent a8e82fb commit d000e37

File tree

6 files changed

+247
-9
lines changed

6 files changed

+247
-9
lines changed

App.config

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
<add key="aspnet:RoslynCompilerLocation" value="roslyn"/>
1010
</appSettings>
1111
<startup>
12-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
12+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
1313
</startup>
14+
<system.codedom>
15+
<compilers>
16+
<compiler
17+
language="c#;cs;csharp"
18+
extension=".cs"
19+
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
20+
warningLevel="4"
21+
compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
22+
<compiler
23+
language="vb;vbs;visualbasic;vbscript"
24+
extension=".vb"
25+
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
26+
warningLevel="4"
27+
compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
28+
</compilers>
29+
</system.codedom>
1430
</configuration>

Desharp.config.example

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
-->
56+
<add key="Desharp:Levels" value="+exception,debug,info,-notice,-warning,+error,+critical,alert,+emergency,javascript" />
57+
58+
<!--
59+
Logged messages notifications by configured levels.
60+
- Not required, recomanded in production mode.
61+
- Possible values:
62+
- `host`: Required, mail server smtp domain | IPv4 | IPv6.
63+
- `port`: Not required, `25` by default.
64+
- `ssl`: Not required, `false` by default.
65+
- `from`: Required if no username and password specified, email address to specify sender, if no value specified, there is used `username` value.
66+
- `username` and `password`: Required if no `from` sender specified, mail server username/password credentials for sender account, always necessary to use together.
67+
- `domain` - Not required, no default value. Used only as third parametter for `System.Net.NetworkCredential` if presented.
68+
- `to`: Required, single recepient email adress or multiple adresses separated by semicolon `;`.
69+
- `priority`: Not required, possible values: `low` | `normal` | `high` (`normal` by defaut).
70+
- `timeout`: Not required, smtp server timeout specified in miliseconds, `10000` by default (10 seconds).
71+
- `background`: Not required at all. Default value is `true` to send all notifications in background thread.
72+
Use `false` value only to debug email sending.
73+
-->
74+
<add key="Desharp:NotifySettings" value="{
75+
host: 'smtp.company.com',
76+
port: 587,
77+
ssl: true,
78+
user: 'noreply@company.com',
79+
password: 'your-secret-password',
80+
from: 'noreply@company.com',
81+
to: 'your.name@gmail.com',
82+
priority: 'high',
83+
timeout: 30000
84+
}" />
85+
86+
<!--
87+
Web debug bar panels.
88+
- Not required, recomanded.
89+
- Full class names separated by comma `,`.
90+
- Panel class has to implement public interface: `Desharp.Panels.IPanel`
91+
- Panel class could implement interface: `Desharp.Panels.ISessionPanel`,
92+
where are method called when session is is read and written every request.
93+
- There are always enabled build-in panels for execution time, dumps and exceptions.
94+
- Build-in panels you can optionally use:
95+
- `Desharp.Panels.SystemInfo` - to display most important request info
96+
- `Desharp.Panels.Session` - to display basic session configuration and values
97+
- `Desharp.Panels.Routing` - to display matched MVC routes (still in TODO state)
98+
-->
99+
<add key="Desharp:Panels" value="Desharp.Panels.SystemInfo,Desharp.Panels.Session" />
100+
101+
<!--
102+
Absolute or relative path from application root directory.
103+
- Not required, recomanded.
104+
- Relative path from app root has to start with '~/' like: '~/Path/To/Logs'.
105+
- If not configured, all log files are written into application root directory.
106+
-->
107+
<add key="Desharp:Directory" value="~/Logs" />
108+
109+
<!--
110+
Always render source location from where dump has been called by `Debug.Dump()`.
111+
- Not required, recomanded.
112+
- Possible values: `1`, `0`, `true`, `false`.
113+
- If not configured, no dumps source locations are rendered in dump ouputs.
114+
-->
115+
<add key="Desharp:SourceLocation" value="1" />
116+
117+
<!--
118+
Milisecond timeout how often logged messages or exceptions are written from memory to hard drive.
119+
- Not required, recomanded for speed optimalization in production mode.
120+
- Possible values - use digits to define any miliseconds integer value.
121+
- If not configured, all messages or exceptions are written immediately
122+
in current thread, where is called `Desharp.Log()`.
123+
-->
124+
<add key="Desharp:WriteMiliseconds" value="5000" />
125+
126+
<!--
127+
.NET objects dumping depth.
128+
- Not required, recomanded for speed optimalization in production mode.
129+
- Possible values: just digit like `2`, `3`, `4` or `5`.
130+
- If not configured, `3` by default.
131+
-->
132+
<add key="Desharp:Depth" value="3" />
133+
134+
<!--
135+
Maximum length for dumped string values.
136+
- Not required, recomanded for speed optimalization in production mode.
137+
- Possible values: just digit like `512`, `1024` or `5000`...
138+
- If not configured, `1024` by default.
139+
-->
140+
<add key="Desharp:MaxLength" value="1024" />
141+
142+
<!--
143+
Custom web error page.
144+
- Not required, recomanded for production mode.
145+
- If `Desharp` is not enabled and there is uncaught exception in your application,
146+
you can use custom static error page to transfer into client browser.
147+
- If not configured - `Desharp` build-in error page is used by default with error 500.
148+
-->
149+
<add key="Desharp:ErrorPage" value="~/custom-error-page-500.html" />
150+
151+
<!--
152+
Dump all internal .NET events, properties ad fields in custom class instances,
153+
(created internally and usually for properties values )and all class instance
154+
member types marked with `System.Runtime.CompilerServices.CompillerGenerated`
155+
attribute or with `Desharp.Hidden` attribute.
156+
This option is usefull to see everything in memory.
157+
- Not required, recomanded only for deep development view.
158+
- Possible values: `1`, `0`, `true`, `false`.
159+
- If not configured, `false` by default.
160+
- If not configured or configured as `false`, you can hide
161+
your class members for dumping and logging by attributes:
162+
- [System.Runtime.CompilerServices.CompilerGenerated] - .NET standard.
163+
- [Desharp.Hidden] - shorter.
164+
-->
165+
<add key="Desharp:DumpCompillerGenerated" value="true" />
166+
167+
<!--
168+
Default editor param value.
169+
- Not required, marginal.
170+
- For automatic file opening in Visual Studio or in any other editor by rendered links:
171+
`<a href="editor://file=...&line=...&editor=MSVS2019">../File.cs:123</a>
172+
- Possible values: any string key to open your editor from html output by.
173+
- If not configured, value is automaticly detected by Visual Studio instalation on current system.
174+
-->
175+
<add key="Desharp:Editor" value="MSVS2019" />
176+
177+
</appSettings>
178+
</configuration>

ExampleConsoleVb.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("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ExampleConsoleVb", "ExampleConsoleVb.vbproj", "{04B0BE3D-D5A8-4E84-8BC3-CC373CEAB829}"
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+
{04B0BE3D-D5A8-4E84-8BC3-CC373CEAB829}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{04B0BE3D-D5A8-4E84-8BC3-CC373CEAB829}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{04B0BE3D-D5A8-4E84-8BC3-CC373CEAB829}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{04B0BE3D-D5A8-4E84-8BC3-CC373CEAB829}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

ExampleConsoleVb.vbproj

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.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>
@@ -11,9 +12,11 @@
1112
<AssemblyName>ExampleConsoleVb</AssemblyName>
1213
<FileAlignment>512</FileAlignment>
1314
<MyType>Console</MyType>
14-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
15+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1516
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1617
<TargetFrameworkProfile />
18+
<NuGetPackageImportStamp>
19+
</NuGetPackageImportStamp>
1720
</PropertyGroup>
1821
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1922
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -24,6 +27,7 @@
2427
<OutputPath>bin\Debug\</OutputPath>
2528
<DocumentationFile>ExampleConsoleVb.xml</DocumentationFile>
2629
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
30+
<Prefer32Bit>false</Prefer32Bit>
2731
</PropertyGroup>
2832
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2933
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -34,6 +38,7 @@
3438
<OutputPath>bin\Release\</OutputPath>
3539
<DocumentationFile>ExampleConsoleVb.xml</DocumentationFile>
3640
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
41+
<Prefer32Bit>false</Prefer32Bit>
3742
</PropertyGroup>
3843
<PropertyGroup>
3944
<OptionExplicit>On</OptionExplicit>
@@ -49,11 +54,15 @@
4954
</PropertyGroup>
5055
<ItemGroup>
5156
<Reference Include="Desharp, Version=1.3.0.0, Culture=neutral, PublicKeyToken=cd60d985c52bcd6f, processorArchitecture=MSIL">
52-
<HintPath>..\packages\Desharp.1.3.0\lib\net40\Desharp.dll</HintPath>
57+
<HintPath>packages\Desharp.1.3.0\lib\net40\Desharp.dll</HintPath>
5358
<Private>True</Private>
5459
</Reference>
55-
<Reference Include="Desharp.Tests, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
56-
<HintPath>..\packages\Desharp.Tests.1.3.0\lib\net40\Desharp.Tests.dll</HintPath>
60+
<Reference Include="Desharp.Tests, Version=1.3.0.1, Culture=neutral, processorArchitecture=MSIL">
61+
<HintPath>packages\Desharp.Tests.1.3.0.1\lib\net45\Desharp.Tests.dll</HintPath>
62+
<Private>True</Private>
63+
</Reference>
64+
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
65+
<HintPath>packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
5766
<Private>True</Private>
5867
</Reference>
5968
<Reference Include="Microsoft.CSharp" />
@@ -63,6 +72,10 @@
6372
<Reference Include="System.Data" />
6473
<Reference Include="System.Data.DataSetExtensions" />
6574
<Reference Include="System.Runtime.Serialization" />
75+
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
76+
<HintPath>packages\System.ValueTuple.4.5.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
77+
<Private>True</Private>
78+
</Reference>
6679
<Reference Include="System.Web" />
6780
<Reference Include="System.Web.Extensions" />
6881
</ItemGroup>
@@ -104,6 +117,7 @@
104117
</EmbeddedResource>
105118
</ItemGroup>
106119
<ItemGroup>
120+
<None Include="Desharp.config.example" />
107121
<None Include="My Project\Application.myapp">
108122
<Generator>MyApplicationCodeGenerator</Generator>
109123
<LastGenOutput>Application.Designer.vb</LastGenOutput>
@@ -117,6 +131,12 @@
117131
<None Include="packages.config" />
118132
</ItemGroup>
119133
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
134+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
135+
<PropertyGroup>
136+
<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>
137+
</PropertyGroup>
138+
<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'))" />
139+
</Target>
120140
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
121141
Other similar extension points exist, see Microsoft.Common.targets.
122142
<Target Name="BeforeBuild">

My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
3131
' by using the '*' as shown below:
3232
' <Assembly: AssemblyVersion("1.0.*")>
3333

34-
<Assembly: AssemblyVersion("1.3.0.0")>
35-
<Assembly: AssemblyFileVersion("1.3.0.0")>
34+
<Assembly: AssemblyVersion("1.3.0.1")>
35+
<Assembly: AssemblyFileVersion("1.3.0.1")>

packages.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Desharp" version="1.3.0" targetFramework="net40" />
4-
<package id="Desharp.Tests" version="1.3.0" targetFramework="net40" />
5-
<package id="Microsoft.CodeAnalysis" version="3.2.1" targetFramework="net40" />
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)