Skip to content

Commit d4e4121

Browse files
committed
Add --nbloaderverpolicy and BeautyNBLoaderVerPolicy option
related issues: #65
1 parent d2058f5 commit d4e4121

File tree

92 files changed

+75106
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+75106
-22
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __MACOSX
1111
# Build results
1212
[Bb]in/
1313
[Oo]bj/
14+
[Dd]ebug/
1415
[Rr]elease/
1516
[Pp]ublish/
1617
tools/

Common/Common.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<PackageOutputPath>.nupkg</PackageOutputPath>
5-
<Version>2.1.4.5</Version>
5+
<Version>2.1.4.6</Version>
66

77
<Company>nulastudio</Company>
88
<Authors>LiesAuer</Authors>

NetBeauty.sln

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31019.35
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34728.123
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WPFTest", "NetBeautyTest\WPFTest\WPFTest.csproj", "{932C8DC7-1EB0-439B-B7AA-BE719712DA82}"
77
EndProject
@@ -35,6 +35,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WsClient", "NetBeautyTest\S
3535
EndProject
3636
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetFxTest", "NetBeautyTest\NetFxTest\NetFxTest.csproj", "{B00BF1D5-D055-456E-869D-1FD75EF20A29}"
3737
EndProject
38+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RazorTest", "NetBeautyTest\RazorTest\RazorTest.csproj", "{FC735912-F38D-45A6-91AB-981BACE21FCC}"
39+
EndProject
3840
Global
3941
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4042
Debug|Any CPU = Debug|Any CPU
@@ -183,6 +185,18 @@ Global
183185
{B00BF1D5-D055-456E-869D-1FD75EF20A29}.Release|x64.Build.0 = Release|Any CPU
184186
{B00BF1D5-D055-456E-869D-1FD75EF20A29}.Release|x86.ActiveCfg = Release|Any CPU
185187
{B00BF1D5-D055-456E-869D-1FD75EF20A29}.Release|x86.Build.0 = Release|Any CPU
188+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
189+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
190+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Debug|x64.ActiveCfg = Debug|Any CPU
191+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Debug|x64.Build.0 = Debug|Any CPU
192+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Debug|x86.ActiveCfg = Debug|Any CPU
193+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Debug|x86.Build.0 = Debug|Any CPU
194+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
195+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Release|Any CPU.Build.0 = Release|Any CPU
196+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Release|x64.ActiveCfg = Release|Any CPU
197+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Release|x64.Build.0 = Release|Any CPU
198+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Release|x86.ActiveCfg = Release|Any CPU
199+
{FC735912-F38D-45A6-91AB-981BACE21FCC}.Release|x86.Build.0 = Release|Any CPU
186200
EndGlobalSection
187201
GlobalSection(SolutionProperties) = preSolution
188202
HideSolutionNode = FALSE
@@ -201,6 +215,7 @@ Global
201215
{9B772369-9C0E-4ED6-ABE7-815D12923A83} = {3283AE43-F95A-4DF0-940B-D35F1B49DC8B}
202216
{3DDE26EE-956B-4CBC-A427-C5033F667527} = {3283AE43-F95A-4DF0-940B-D35F1B49DC8B}
203217
{B00BF1D5-D055-456E-869D-1FD75EF20A29} = {892E4718-267A-4854-8127-C77903D24F17}
218+
{FC735912-F38D-45A6-91AB-981BACE21FCC} = {892E4718-267A-4854-8127-C77903D24F17}
204219
EndGlobalSection
205220
GlobalSection(ExtensibilityGlobals) = postSolution
206221
SolutionGuid = {E6C30250-7EA2-4421-A76A-39E93BF71486}

NetBeauty/src/main/beauty.go

+22-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ var excludes = ""
4848
var hiddens = ""
4949
var sharedRuntimeMode = false
5050
var noRuntimeInfo = false
51+
52+
// auto with without
53+
var nbloaderVerPolicy = "auto"
5154
var enableDebug = false
5255
var usePatch = false
5356
var isNetFx = false
@@ -157,7 +160,19 @@ func main() {
157160
log.LogDetail("Use Patch: No")
158161
}
159162

160-
success := manager.AddStartUpHookToDeps(deps.deps, startupHook, startupHookVersion)
163+
_startupHookVersion := ""
164+
165+
if nbloaderVerPolicy == "" || nbloaderVerPolicy == "auto" {
166+
if manager.CheckNeedStartHookVersion(deps.deps) {
167+
_startupHookVersion = startupHookVersion
168+
}
169+
} else if nbloaderVerPolicy == "with" {
170+
_startupHookVersion = startupHookVersion
171+
} else if nbloaderVerPolicy == "" {
172+
_startupHookVersion = ""
173+
}
174+
175+
success := manager.AddStartUpHookToDeps(deps.deps, startupHook, _startupHookVersion)
161176

162177
usePatch = SCDMode && usePatch
163178

@@ -409,6 +424,8 @@ Info: Log everything.
409424
flag.BoolVar(&usePatch, "usepatch", false, `[.NET Core App Only] use the patched hostfxr to reduce files`)
410425
flag.StringVar(&hiddens, "hiddens", "", `dlls that end users never needed, so hide them.`)
411426
flag.StringVar(&rollForward, "roll-forward", "", `override default roll-forward behavior, see https://learn.microsoft.com/en-us/dotnet/core/versions/selection#control-roll-forward-behavior for more details.`)
427+
flag.StringVar(&nbloaderVerPolicy, "nbloaderverpolicy", "auto", `nbloader versioning policy, see https://github.com/nulastudio/NetBeauty2/issues/65 for more details.
428+
`)
412429
flag.StringVar(&appHostEntry, "apphostentry", "", `[.NET Core Non Single-File App Only] patch apphost entry location.`)
413430
flag.StringVar(&appHostDir, "apphostdir", "", `[.NET Core Non Single-File App Only] relative path based on beautyDir.`)
414431

@@ -501,6 +518,9 @@ Info: Log everything.
501518
}
502519
beautyDir = absDir
503520

521+
nbloaderVerPolicy = strings.TrimSpace(nbloaderVerPolicy)
522+
nbloaderVerPolicy = strings.ToLower(nbloaderVerPolicy)
523+
504524
appHostEntry = strings.Trim(appHostEntry, `"`)
505525
strings.ReplaceAll(appHostEntry, "\\", "/")
506526

@@ -528,7 +548,7 @@ func exit() {
528548

529549
func usage() {
530550
fmt.Println("Usage:")
531-
fmt.Println("nbeauty [--loglevel=(Error|Detail|Info)] [--srmode] [--enabledebug] [--usepatch] [--hiddens=hiddenFiles] [--noruntimeinfo] [--roll-forward=<rollForward>] [--apphostentry=<appHostEntry>] [--apphostdir=<appHostDir>] <beautyDir> [<libsDir> [<excludes>]]")
551+
fmt.Println("nbeauty [--loglevel=(Error|Detail|Info)] [--srmode] [--enabledebug] [--usepatch] [--hiddens=hiddenFiles] [--noruntimeinfo] [--roll-forward=<rollForward>] [--nbloaderverpolicy=(auto|with|without)] [--apphostentry=<appHostEntry>] [--apphostdir=<appHostDir>] <beautyDir> [<libsDir> [<excludes>]]")
532552
fmt.Println("")
533553
fmt.Println("Arguments")
534554
fmt.Println(" <excludes> dlls that no need to be moved, multi-dlls separated with \";\". Example: dll1.dll;lib*;...")

NetBeauty/src/main/bindata.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NetBeauty/src/manager/manager.go

+98-2
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,27 @@ func AddStartUpHookToDeps(deps string, hook string, version string) bool {
280280

281281
runtimeTarget, _ := json.GetPath("runtimeTarget", "name").String()
282282

283+
hookEntry := hook
284+
285+
if version != "" {
286+
hookEntry = hook + "/" + version
287+
288+
log.LogDetail("Need NBLoader Version: Yes")
289+
} else {
290+
log.LogDetail("Need NBLoader Version: No")
291+
}
292+
283293
json.SetPath([]string{
284294
"targets",
285295
runtimeTarget,
286-
hook + "/" + version,
296+
hookEntry,
287297
"runtime",
288298
hook + ".dll",
289299
}, make(map[string]interface{}))
290300

291301
json.SetPath([]string{
292302
"libraries",
293-
hook + "/" + version,
303+
hookEntry,
294304
}, map[string]interface{}{
295305
"type": "project",
296306
"serviceable": false,
@@ -708,6 +718,92 @@ func FindFXRVersion(deps string) (string, string) {
708718
return "", ""
709719
}
710720

721+
// CheckNeedStartHookVersion 分析deps.json中是否需要添加starthook版本号的依赖项
722+
func CheckNeedStartHookVersion(deps string) bool {
723+
var allAnalyzedDeps = make([]analyzedDeps, 0)
724+
725+
jsonBytes, err := ioutil.ReadFile(deps)
726+
if err != nil {
727+
return false
728+
}
729+
730+
json, err := simplejson.NewJson(jsonBytes)
731+
if err != nil {
732+
return false
733+
}
734+
735+
targets, _ := json.Get("targets").Map()
736+
for _, target := range targets {
737+
for _, depsObj := range target.(map[string]interface{}) {
738+
runtime := depsObj.(map[string]interface{})["runtime"]
739+
if runtime != nil {
740+
for filePath := range runtime.(map[string]interface{}) {
741+
filePath2 := strings.ReplaceAll(filePath, "\\", "/")
742+
parts := strings.Split(filePath2, "/")
743+
fileName := parts[len(parts)-1]
744+
745+
allAnalyzedDeps = append(allAnalyzedDeps, analyzedDeps{
746+
Category: runtime.(map[string]interface{}),
747+
ItemKey: filePath,
748+
Name: fileName,
749+
Path: fileName,
750+
SecondPath: fileName,
751+
Type: Assembly,
752+
Locale: "",
753+
})
754+
}
755+
}
756+
757+
resources := depsObj.(map[string]interface{})["resources"]
758+
if resources != nil {
759+
for filePath, locale := range resources.(map[string]interface{}) {
760+
filePath2 := strings.ReplaceAll(filePath, "\\", "/")
761+
parts := strings.Split(filePath2, "/")
762+
fileName := parts[len(parts)-1]
763+
culture := locale.(map[string]interface{})["locale"].(string)
764+
765+
allAnalyzedDeps = append(allAnalyzedDeps, analyzedDeps{
766+
Category: resources.(map[string]interface{}),
767+
ItemKey: filePath,
768+
Name: fileName,
769+
Path: culture + "/" + fileName,
770+
SecondPath: culture + "/" + fileName,
771+
Type: Resource,
772+
Locale: culture,
773+
})
774+
}
775+
}
776+
777+
native := depsObj.(map[string]interface{})["native"]
778+
if native != nil {
779+
for filePath := range native.(map[string]interface{}) {
780+
filePath2 := strings.ReplaceAll(filePath, "\\", "/")
781+
parts := strings.Split(filePath2, "/")
782+
fileName := parts[len(parts)-1]
783+
784+
allAnalyzedDeps = append(allAnalyzedDeps, analyzedDeps{
785+
Category: native.(map[string]interface{}),
786+
ItemKey: filePath,
787+
Name: fileName,
788+
Path: fileName,
789+
SecondPath: filePath2,
790+
Type: Native,
791+
Locale: "",
792+
})
793+
}
794+
}
795+
}
796+
}
797+
798+
for _, analyzed := range allAnalyzedDeps {
799+
if strings.Contains(analyzed.Name, "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation") {
800+
return true
801+
}
802+
}
803+
804+
return false
805+
}
806+
711807
// FixDeps 分析deps.json中的依赖项
712808
func FixDeps(deps string, entry string, SCDMode bool, noRuntimeInfo bool, usePatch bool, enableDebug bool, sharedRuntimeMode bool) ([]Deps, bool, bool) {
713809
var isAspNetCore = false

NetBeauty/src/nbloader/nbloader.dll

-9.68 KB
Binary file not shown.

NetBeautyNuget/Beauty.targets

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<BeautyUsePatch Condition="$(BeautyUsePatch) == 'True'">--usepatch</BeautyUsePatch>
2323
<BeautyNoRuntimeInfo Condition="$(BeautyNoRuntimeInfo) != 'True'"></BeautyNoRuntimeInfo>
2424
<BeautyNoRuntimeInfo Condition="$(BeautyNoRuntimeInfo) == 'True'">--noruntimeinfo</BeautyNoRuntimeInfo>
25+
<BeautyNBLoaderVerPolicy Condition="$(BeautyNBLoaderVerPolicy) != ''">--nbloaderverpolicy "$(BeautyNBLoaderVerPolicy)"</BeautyNBLoaderVerPolicy>
2526
<BeautyAppHostEntry Condition="$(BeautyAppHostEntry) != ''">--apphostentry "$(BeautyAppHostEntry)"</BeautyAppHostEntry>
2627
<BeautyAppHostDir Condition="$(BeautyAppHostDir) != ''">--apphostdir "$(BeautyAppHostDir)"</BeautyAppHostDir>
2728
<_BeautyDependsOnForBuild_NetFx Condition="'$(MSBuildRuntimeType)' == 'Full'">AfterBuild;$(BeautyAfterTasks)</_BeautyDependsOnForBuild_NetFx>
@@ -115,7 +116,7 @@ Args = string.Join(" ", CommandLineArgs);
115116
<BeautyDir>"%(_BeautyPublishDir.FullPath)/."</BeautyDir>
116117
</PropertyGroup>
117118

118-
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
119+
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyNBLoaderVerPolicy) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
119120
</Target>
120121

121122
<Target Name="NetBeautyOnPublish_Fx" AfterTargets="$(_BeautyDependsOnForPublish_NetFx)" Condition="$(DisableBeauty) != 'True' And '$(_BeautyOnBuild)' != 'True'">
@@ -129,17 +130,17 @@ Args = string.Join(" ", CommandLineArgs);
129130
<BeautyDir2>"%(_BeautyPublishDir2.FullPath)/."</BeautyDir2>
130131
</PropertyGroup>
131132

132-
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
133+
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyNBLoaderVerPolicy) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
133134

134-
<Exec Condition="'$(BeautyDir2)' != '$(BeautyDir)'" Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir2) $(BeautyLibsDir) $(BeautyExcludes)" />
135+
<Exec Condition="'$(BeautyDir2)' != '$(BeautyDir)'" Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyNBLoaderVerPolicy) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir2) $(BeautyLibsDir) $(BeautyExcludes)" />
135136
</Target>
136137

137138
<Target Name="NetBeautyOnBuild" AfterTargets="$(_BeautyDependsOnForBuild_Core)" Condition="$(DisableBeauty) != 'True' And '$(_BeautyOnBuild)' == 'True'">
138139
<PropertyGroup>
139140
<BeautyDir>"$(TargetDir)/."</BeautyDir>
140141
</PropertyGroup>
141142

142-
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
143+
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyNBLoaderVerPolicy) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
143144
</Target>
144145

145146
<Target Name="NetBeautyOnPublish" AfterTargets="$(_BeautyDependsOnForPublish_Core)" Condition="$(DisableBeauty) != 'True' And '$(_BeautyOnBuild)' != 'True'">
@@ -151,6 +152,6 @@ Args = string.Join(" ", CommandLineArgs);
151152
<BeautyDir>"%(_BeautyPublishDir.FullPath)/."</BeautyDir>
152153
</PropertyGroup>
153154

154-
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
155+
<Exec Command="$(BeautyBin) $(BeautyGitCDN) $(BeautyGitTree) $(BeautyLogLevel) $(BeautySharedRuntimeMode) $(BeautyEnableDebugging) $(BeautyUsePatch) $(BeautyHiddens) $(BeautyNoRuntimeInfo) $(BeautyNBLoaderVerPolicy) $(BeautyAppHostEntry) $(BeautyAppHostDir) $(BeautyDir) $(BeautyLibsDir) $(BeautyExcludes)" />
155156
</Target>
156157
</Project>

NetBeautyTest/AvaloniaTest/AvaloniaTest/AvaloniaTest.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
<BeautyOnPublishOnly>False</BeautyOnPublishOnly>
2929
<!-- DO NOT TOUCH THIS OPTION -->
3030
<BeautyNoRuntimeInfo>False</BeautyNoRuntimeInfo>
31+
<!-- valid values: auto|with|without -->
32+
<BeautyNBLoaderVerPolicy>auto</BeautyNBLoaderVerPolicy>
3133
<!-- set to True if you want to allow 3rd debuggers(like dnSpy) debugs the app -->
3234
<BeautyEnableDebugging>False</BeautyEnableDebugging>
3335
<!-- the patch can reduce the file count -->
@@ -51,7 +53,7 @@
5153
</PropertyGroup>
5254

5355
<ItemGroup>
54-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.5" />
56+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.6" />
5557
</ItemGroup>
5658

5759
</Project>

NetBeautyTest/ChromelyTest/ChromelyTest.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
<BeautyOnPublishOnly>False</BeautyOnPublishOnly>
5757
<!-- DO NOT TOUCH THIS OPTION -->
5858
<BeautyNoRuntimeInfo>False</BeautyNoRuntimeInfo>
59+
<!-- valid values: auto|with|without -->
60+
<BeautyNBLoaderVerPolicy>auto</BeautyNBLoaderVerPolicy>
5961
<!-- set to True if you want to allow 3rd debuggers(like dnSpy) debugs the app -->
6062
<BeautyEnableDebugging>False</BeautyEnableDebugging>
6163
<!-- the patch can reduce the file count -->
@@ -79,7 +81,7 @@
7981
</PropertyGroup>
8082

8183
<ItemGroup>
82-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.5" />
84+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.6" />
8385
</ItemGroup>
8486

8587
</Project>

NetBeautyTest/NetFxTest/NetFxTest.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
<BeautyOnPublishOnly>False</BeautyOnPublishOnly>
5151
<!-- DO NOT TOUCH THIS OPTION -->
5252
<BeautyNoRuntimeInfo>False</BeautyNoRuntimeInfo>
53+
<!-- valid values: auto|with|without -->
54+
<BeautyNBLoaderVerPolicy>auto</BeautyNBLoaderVerPolicy>
5355
<!-- set to True if you want to allow 3rd debuggers(like dnSpy) debugs the app -->
5456
<BeautyEnableDebugging>False</BeautyEnableDebugging>
5557
<!-- the patch can reduce the file count -->
@@ -156,7 +158,7 @@
156158
</ItemGroup>
157159
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
158160
<ItemGroup>
159-
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.5" />
161+
<PackageReference Include="nulastudio.NetBeauty" Version="2.1.4.6" />
160162
<PackageReference Include="SixLabors.ImageSharp">
161163
<Version>2.1.9</Version>
162164
</PackageReference>
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>
27+

0 commit comments

Comments
 (0)