Dev: Helps Rider to find Layouts properly (#7283)
What changed, and why it matters
This commit is a developer-experience tweak. It changes how Razor view files reference their page layouts so that the JetBrains Rider IDE can find them more reliably. It also updates a test assertion style and bumps the C# language version from 12 to 14. There is no security-relevant change.
No security action required. This is a routine developer-tooling and build-configuration change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit normalizes Layout assignments in .cshtml files by adding the .cshtml extension and, for nested ImportWallet views, a relative ../ path. This helps JetBrains Rider resolve layout/partial view references. It also replaces Assert.DoesNotContain(null, …) with Assert.All(…, Assert.NotNull) in a test and bumps LangVersion from 12.0 to 14.0 in Build/Common.csproj. No runtime behavior, authorization, cryptography, or input handling is altered.
Changed components
BTCPayServer/Views/UIError/*.cshtmlBTCPayServer/Views/UIStores/GenerateWallet.cshtmlBTCPayServer/Views/UIStores/GenerateWalletOptions.cshtmlBTCPayServer/Views/UIStores/ImportWallet/*.cshtmlBTCPayServer/Views/UIStores/ImportWalletOptions.cshtmlBTCPayServer/Views/UIStores/SetupWallet.cshtmlBTCPayServer/Program.cs (comment only)BTCPayServer.Tests/PullPaymentsTests.csBuild/Common.csprojInspect captured patch +22 / −22
diff --git a/BTCPayServer.Tests/PullPaymentsTests.cs b/BTCPayServer.Tests/PullPaymentsTests.cs
index 38ca3a4..de93926 100644
--- a/BTCPayServer.Tests/PullPaymentsTests.cs
+++ b/BTCPayServer.Tests/PullPaymentsTests.cs
@@ -896,7 +896,7 @@ public class PullPaymentsTests(ITestOutputHelper helper) : UnitTestBase(helper)
});
Assert.Equal(0, card.Version);
var card1Keys = new[] { card.K0, card.K1, card.K2, card.K3, card.K4 };
- Assert.DoesNotContain(null, card1Keys);
+ Assert.All(card1Keys, Assert.NotNull);
var card2 = await client.RegisterBoltcard(test4.Id, new RegisterBoltcardRequest()
{
@@ -912,7 +912,7 @@ public class PullPaymentsTests(ITestOutputHelper helper) : UnitTestBase(helper)
Assert.StartsWith("lnurlw://", card2.LNURLW);
Assert.EndsWith("/boltcard", card2.LNURLW);
var card2Keys = new[] { card2.K0, card2.K1, card2.K2, card2.K3, card2.K4 };
- Assert.DoesNotContain(null, card2Keys);
+ Assert.All(card2Keys, Assert.NotNull);
for (var i = 0; i < card1Keys.Length; i++)
{
if (i == 1)
diff --git a/BTCPayServer/Program.cs b/BTCPayServer/Program.cs
index d80a689..8fa105e 100644
--- a/BTCPayServer/Program.cs
+++ b/BTCPayServer/Program.cs
@@ -16,7 +16,7 @@ using Microsoft.Extensions.Logging;
[assembly: InternalsVisibleTo("BTCPayServer.Tests")]
-// This help JetBrains to find partial views referenced by views in plugins
+// This helps JetBrains to find partial views referenced by views in plugins
[assembly: JetBrains.Annotations.AspMvcAreaPartialViewLocationFormat("/Plugins/{2}/Views/Shared/{0}.cshtml")]
namespace BTCPayServer
diff --git a/BTCPayServer/Views/UIError/403.cshtml b/BTCPayServer/Views/UIError/403.cshtml
index fd78a53..b5e93cd 100644
--- a/BTCPayServer/Views/UIError/403.cshtml
+++ b/BTCPayServer/Views/UIError/403.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "403 - Denied";
}
diff --git a/BTCPayServer/Views/UIError/404.cshtml b/BTCPayServer/Views/UIError/404.cshtml
index 6226770..5a0374c 100644
--- a/BTCPayServer/Views/UIError/404.cshtml
+++ b/BTCPayServer/Views/UIError/404.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "404 - Page not found";
}
diff --git a/BTCPayServer/Views/UIError/406.cshtml b/BTCPayServer/Views/UIError/406.cshtml
index b1cf25a..e5c3e09 100644
--- a/BTCPayServer/Views/UIError/406.cshtml
+++ b/BTCPayServer/Views/UIError/406.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "406 - Not Acceptable";
}
diff --git a/BTCPayServer/Views/UIError/417.cshtml b/BTCPayServer/Views/UIError/417.cshtml
index 72e5f60..ac48ef5 100644
--- a/BTCPayServer/Views/UIError/417.cshtml
+++ b/BTCPayServer/Views/UIError/417.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "417 - Expectation Failed";
}
diff --git a/BTCPayServer/Views/UIError/429.cshtml b/BTCPayServer/Views/UIError/429.cshtml
index 52124bc..5ddb6fe 100644
--- a/BTCPayServer/Views/UIError/429.cshtml
+++ b/BTCPayServer/Views/UIError/429.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "429 - Too Many Requests";
}
diff --git a/BTCPayServer/Views/UIError/500.cshtml b/BTCPayServer/Views/UIError/500.cshtml
index b7338ea..08fbe89 100644
--- a/BTCPayServer/Views/UIError/500.cshtml
+++ b/BTCPayServer/Views/UIError/500.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "500 - Internal Server Error";
}
diff --git a/BTCPayServer/Views/UIError/502.cshtml b/BTCPayServer/Views/UIError/502.cshtml
index 08055a4..0c1228b 100644
--- a/BTCPayServer/Views/UIError/502.cshtml
+++ b/BTCPayServer/Views/UIError/502.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "502 - Bad Gateway";
}
diff --git a/BTCPayServer/Views/UIError/Handle.cshtml b/BTCPayServer/Views/UIError/Handle.cshtml
index 2ef1cee..2586b2a 100644
--- a/BTCPayServer/Views/UIError/Handle.cshtml
+++ b/BTCPayServer/Views/UIError/Handle.cshtml
@@ -3,7 +3,7 @@
@using BTCPayServer.Controllers
@model int?
@{
- Layout = "_LayoutError";
+ Layout = "_LayoutError.cshtml";
ViewData["Title"] = "Generic Error occurred";
if (Model.HasValue)
{
diff --git a/BTCPayServer/Views/UIStores/GenerateWallet.cshtml b/BTCPayServer/Views/UIStores/GenerateWallet.cshtml
index eee0fd0..4f933cc 100644
--- a/BTCPayServer/Views/UIStores/GenerateWallet.cshtml
+++ b/BTCPayServer/Views/UIStores/GenerateWallet.cshtml
@@ -2,7 +2,7 @@
@{
var isHotWallet = Model.Method == WalletSetupMethod.HotWallet;
var title = isHotWallet ? StringLocalizer["Create {0} Hot Wallet", Model.CryptoCode] : StringLocalizer["Create {0} Watch-Only Wallet", Model.CryptoCode];
- Layout = "_LayoutWalletSetup";
+ Layout = "_LayoutWalletSetup.cshtml";
ViewData.SetTitle(title);
Model.SetViewData(ViewData);
}
diff --git a/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml b/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml
index e4e17ea..6fe868e 100644
--- a/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml
+++ b/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml
@@ -2,7 +2,7 @@
@inject Microsoft.Extensions.Localization.IStringLocalizer StringLocalizer
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Generate {0} Wallet", Model.CryptoCode]);
}
diff --git a/BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml
index 0a2ac5d..37e3c6b 100644
--- a/BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWallet/ConfirmAddresses.cshtml
@@ -1,6 +1,6 @@
@model WalletSetupViewModel
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "../_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Confirm addresses"]);
}
diff --git a/BTCPayServer/Views/UIStores/ImportWallet/File.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/File.cshtml
index 6bd2ad8..848e4ce 100644
--- a/BTCPayServer/Views/UIStores/ImportWallet/File.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWallet/File.cshtml
@@ -1,6 +1,6 @@
@model WalletSetupViewModel
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "../_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Import your wallet file"]);
}
diff --git a/BTCPayServer/Views/UIStores/ImportWallet/Hardware.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/Hardware.cshtml
index a49a68e..d8a0c86 100644
--- a/BTCPayServer/Views/UIStores/ImportWallet/Hardware.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWallet/Hardware.cshtml
@@ -2,7 +2,7 @@
@model WalletSetupViewModel
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "../_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Connect your hardware wallet"]);
this.ViewData.SetBlazorAllowed(true);
}
diff --git a/BTCPayServer/Views/UIStores/ImportWallet/Scan.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/Scan.cshtml
index 407e883..4ecddd9 100644
--- a/BTCPayServer/Views/UIStores/ImportWallet/Scan.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWallet/Scan.cshtml
@@ -1,7 +1,7 @@
@inject BTCPayServer.Security.ContentSecurityPolicies Csp
@model WalletSetupViewModel
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "../_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Scan QR code"]);
Csp.UnsafeEval();
}
diff --git a/BTCPayServer/Views/UIStores/ImportWallet/Seed.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/Seed.cshtml
index cb43c40..3641df3 100644
--- a/BTCPayServer/Views/UIStores/ImportWallet/Seed.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWallet/Seed.cshtml
@@ -1,6 +1,6 @@
@model WalletSetupViewModel
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "../_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Enter the wallet seed"]);
}
diff --git a/BTCPayServer/Views/UIStores/ImportWallet/Xpub.cshtml b/BTCPayServer/Views/UIStores/ImportWallet/Xpub.cshtml
index a0b05a2..185d598 100644
--- a/BTCPayServer/Views/UIStores/ImportWallet/Xpub.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWallet/Xpub.cshtml
@@ -1,6 +1,6 @@
@model WalletSetupViewModel
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "../_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Enter your extended public key"]);
}
diff --git a/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml b/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml
index 316dd91..872930f 100644
--- a/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml
+++ b/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml
@@ -4,7 +4,7 @@
@inject BTCPayNetworkProvider BTCPayNetworkProvider
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Import {0} Wallet", Model.CryptoCode]);
}
diff --git a/BTCPayServer/Views/UIStores/SetupWallet.cshtml b/BTCPayServer/Views/UIStores/SetupWallet.cshtml
index 156aeb6..9dafbfc 100644
--- a/BTCPayServer/Views/UIStores/SetupWallet.cshtml
+++ b/BTCPayServer/Views/UIStores/SetupWallet.cshtml
@@ -3,7 +3,7 @@
@inject Microsoft.Extensions.Localization.IStringLocalizer StringLocalizer
@{
- Layout = "_LayoutWalletSetup";
+ Layout = "_LayoutWalletSetup.cshtml";
ViewData.SetTitle(StringLocalizer["Setup {0} Wallet", Model.CryptoCode]);
}
diff --git a/Build/Common.csproj b/Build/Common.csproj
index 9407247..cce79cb 100644
--- a/Build/Common.csproj
+++ b/Build/Common.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<NoWarn>$(NoWarn),NU1701,CA1816,CA1308,CA1810,CA2208,CA1303,CA2000,CA2016,CA1835,CA2249,CA9998,CA1704;CS8981</NoWarn>
- <LangVersion>12.0</LangVersion>
+ <LangVersion>14.0</LangVersion>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<AnalysisLevel>6.0</AnalysisLevel>
</PropertyGroup>
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.