Skip to content

Commit 8dc2db5

Browse files
author
Dominik Graf
committed
Update app.sln and app.csproj
1 parent a521249 commit 8dc2db5

File tree

2 files changed

+56
-35
lines changed

2 files changed

+56
-35
lines changed

app.csproj

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,65 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<!-- This file helps VS Code provide IntelliSense - see https://go.2sxc.org/vscode -->
3+
<!-- Template v2024-06-19. If you have issues, try getting a newer copy from the url above -->
34

5+
<!-- Specify the default Namespace for C# code in this specific App -->
46
<PropertyGroup>
5-
<!-- Specify the .net Framework you are targeting - this is usually net4.7.2 or net4.8
6-
https://learn.microsoft.com/en-us/dotnet/standard/frameworks
7-
- eg "net472", "net48", "net8.0" etc.
8-
- net472 is the default for DNN 9.8 and earlier but usually net48 works
9-
- net8.0 is the default for Oqtane 5
10-
-->
11-
<TargetFramework>net472</TargetFramework>
7+
<RootNamespace>AppCode</RootNamespace>
8+
</PropertyGroup>
129

13-
<!-- Specify the default Namespace for code in this specific App -->
14-
<RootNamespace>ThisApp</RootNamespace>
10+
<!-- First: Detect if it's running in Dnn, Oqtane-Production or Oqtane-Dev -->
11+
<PropertyGroup>
12+
<RunningInDnn Condition="Exists('..\..\..\..\bin\DotNetNuke.dll')">true</RunningInDnn>
13+
<RunningInOqtane Condition="Exists('..\..\..\Oqtane.Server.dll') Or Exists('..\..\..\bin\Debug\net8.0\Oqtane.Server.dll')">true</RunningInOqtane>
14+
<OqtaneIsProd Condition="Exists('..\..\..\Oqtane.Server.dll')">true</OqtaneIsProd>
15+
<OqtaneIsDev Condition="Exists('..\..\..\bin\Debug\net8.0\Oqtane.Server.dll')">true</OqtaneIsDev>
16+
</PropertyGroup>
1517

16-
<!-- Specify what C# version to use
17-
https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-version-history
18-
- eg. "7.3", "8.0" or "12.0" (Oqtane 5+)
19-
-->
18+
<!-- Settings for Dnn -->
19+
<PropertyGroup Condition="'$(RunningInDnn)' == 'true'">
20+
<!-- Specify .net 4.7.2, C# 8.0 and Bin folder for DNN - see https://go.2sxc.org/vscode -->
21+
<TargetFramework>net472</TargetFramework>
2022
<LangVersion>8.0</LangVersion>
21-
22-
<!-- Variable to path where the DLLs are in Dnn
23-
- This allows you to easily adjust the path if you have a different location
24-
- For clarity / consistency, we recommend to not end with a slash
25-
- Below you will use it using $(PathBin)
26-
-->
27-
<!-- PathBin for Dnn -->
2823
<PathBin>..\..\..\..\bin</PathBin>
29-
<!-- PathBin Oqtane production, just up 3 folders, no bin-subfolder -->
30-
<!-- <PathBin>..\..\..</PathBin> -->
31-
<!-- PathBin Oqtane dev/debug, up 3 folders and current build folder -->
32-
<!-- <PathBin>..\..\..\bin\Debug\net8.0</PathBin> -->
24+
</PropertyGroup>
25+
26+
<!-- Settings for Oqtane -->
27+
<PropertyGroup Condition="'$(RunningInOqtane)' == 'true'">
28+
<!-- Oqtane 5+ uses .net 8 and a very new C# language version -->
29+
<TargetFramework>net8.0</TargetFramework>
30+
<LangVersion>latest</LangVersion>
31+
32+
<!-- PathBin Oqtane production, the bin folder is in the root, just up 3 folders, no bin-subfolder -->
33+
<PathBin Condition="'$(OqtaneIsProd)' == 'true'">..\..\..</PathBin>
34+
35+
<!-- PathBin Oqtane dev/debug, the bin folder is deeper down, up 3 folders and current build folder -->
36+
<PathBin Condition="'$(OqtaneIsDev)' == 'true'">..\..\..\bin\Debug\net8.0</PathBin>
3337
</PropertyGroup>
3438

3539

40+
<!-- IntelliSense: Load all DLLs which exist in Dnn and Oqtane from the bin folder -->
3641
<ItemGroup>
37-
<!-- Tell Visual Studio & VSCode to respect all ToSic.* DLLs in the root bin folder -->
3842
<Reference Include="$(PathBin)\ToSic.*.dll" />
43+
<Reference Include="$(PathBin)\Connect.Koi.dll" />
44+
45+
<!-- Common Microsoft DLLs -->
46+
<Reference Include="$(PathBin)\System.Text.Json.dll" />
3947

48+
<!-- Also load files in the Dependencies folder of the current App -->
49+
<Reference Include="Dependencies\*.dll" />
50+
</ItemGroup>
51+
52+
<!-- IntelliSense: DNN specific -->
53+
<ItemGroup Condition="'$(RunningInDnn)' == 'true'">
4054
<!-- also add System.Web and DotNetNuke DLLs - useful when creating APIs, but be aware that it may make your code less hybrid -->
4155
<Reference Include="$(PathBin)\DotNetNuke.dll" />
4256
<Reference Include="$(PathBin)\DotNetNuke.*.dll" />
4357
<Reference Include="$(PathBin)\System.Web.Http.dll" />
4458
<Reference Include="$(PathBin)\System.Web.WebPages.dll" />
45-
<Reference Include="$(PathBin)\System.Net.Http.dll" />
4659

4760
<!-- System.Web is not in the DNN folder but in the .net Framework installed on the server -->
4861
<Reference Include="System.Web" />
49-
</ItemGroup>
50-
51-
<!-- Additional DLLs which Mobius needs-->
52-
<ItemGroup>
53-
<!-- Mobius also needs the CSV helper-->
54-
<Reference Include="$(PathBin)\CSVHelper.dll" />
55-
<Reference Include="$(PathBin)\Connect.Koi.dll" />
62+
<Reference Include="System.Net.Http" />
5663
</ItemGroup>
5764

5865
<!-- Polymorphism
@@ -68,4 +75,5 @@
6875
<Compile Remove="live\**" />
6976
<EmbeddedResource Remove="live\**" />
7077
</ItemGroup>
71-
</Project>
78+
79+
</Project>

app.sln

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,18 @@ EndProject
99
# This is necessary so that VS Code can perform intellisense in Razor
1010
# It also requires a csproj file to exist as well
1111
#
12-
# Read more on https://go.2sxc.org/vscode
12+
# Read more and get help for issues on https://go.2sxc.org/vscode
1313
#
14+
15+
# Addition 2024-05
16+
# The following section is suddenly required by the C# DevKit
17+
# See https://github.com/microsoft/vscode-dotnettools/issues/1151
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Release|Any CPU = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(SolutionProperties) = preSolution
24+
HideSolutionNode = FALSE
25+
EndGlobalSection
26+
EndGlobal

0 commit comments

Comments
 (0)