diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions.csproj b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions.csproj
index 97d5b8b2a3..466589a027 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions.csproj
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions.csproj
@@ -5,6 +5,8 @@
net7.0
+ enable
+ Nullable
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs
index b972ae0840..36e981e698 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleConfigurationCollection.cs
@@ -27,7 +27,7 @@ public class BundleConfigurationCollection
/// Returns this object for chained calls.
public BundleConfigurationCollection Add(
[NotNull] string bundleName,
- [CanBeNull] Action configureAction = null)
+ Action? configureAction = null)
{
if (!TryAdd(bundleName, configureAction))
{
@@ -52,7 +52,7 @@ public class BundleConfigurationCollection
/// Returns true if added. Returns false if it's already added before.
public bool TryAdd(
[NotNull] string bundleName,
- [CanBeNull] Action configureAction = null,
+ Action? configureAction = null,
bool overrideIfExists = false)
{
Check.NotNull(bundleName, nameof(bundleName));
@@ -78,7 +78,7 @@ public class BundleConfigurationCollection
return true;
}
- private BundleConfiguration CreateBundle(string bundleName, Action configureAction)
+ private BundleConfiguration CreateBundle(string bundleName, Action? configureAction)
{
var bundle = new BundleConfiguration(bundleName);
diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleContributorCollection.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleContributorCollection.cs
index 32dd23a6ee..5f245c1827 100644
--- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleContributorCollection.cs
+++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions/Volo/Abp/AspNetCore/Mvc/UI/Bundling/BundleContributorCollection.cs
@@ -54,7 +54,7 @@ public class BundleContributorCollection
if (!includeDependencies)
{
_contributors.ReplaceOne(x => x.GetType() == sourceContributorType,
- contributor => (IBundleContributor)Activator.CreateInstance(destContributorType));
+ contributor => (IBundleContributor)Activator.CreateInstance(destContributorType)!);
}
else
{
@@ -131,7 +131,7 @@ public class BundleContributorCollection
try
{
- _contributors.Add((IBundleContributor)Activator.CreateInstance(contributorType));
+ _contributors.Add((IBundleContributor)Activator.CreateInstance(contributorType)!);
}
catch (Exception ex)
{