Skip to content

Commit 8889523

Browse files
committed
Adding the assembly configuration (Release or Debug) to the project loader
1 parent f9d05b0 commit 8889523

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/SqlProjectResource.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.Build.Evaluation;
22
using Microsoft.SqlServer.Dac;
3+
using System.Reflection;
34

45
namespace Aspire.Hosting.ApplicationModel;
56

@@ -15,6 +16,11 @@ string IResourceWithDacpac.GetDacpacPath()
1516
{
1617
var projectPath = projectMetadata.ProjectPath;
1718
using var projectCollection = new ProjectCollection();
19+
20+
var attr = GetType().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>();
21+
if (attr is not null)
22+
projectCollection.SetGlobalProperty("Configuration", attr.Configuration);
23+
1824
var project = projectCollection.LoadProject(projectPath);
1925

2026
// .sqlprojx has a SqlTargetPath property, so try that first

0 commit comments

Comments
 (0)