Skip to content

Commit

Permalink
Fix showstopper bug in SQL Projects hosting extension: (#519)
Browse files Browse the repository at this point in the history
- Use correct assembly reference to determine configuration

- Add more logging to console logs

Co-authored-by: Aaron Powell <me@aaron-powell.com>
  • Loading branch information
ErikEJ and aaronpowell authored Mar 2, 2025
1 parent a85e060 commit a80a229
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ await resourceNotificationService.PublishUpdateAsync(resource,
state => state with { State = new ResourceStateSnapshot(KnownResourceStates.FailedToStart, KnownResourceStateStyles.Error) });
return;
}
else
{
logger.LogInformation("SQL Server Database project package found at path {DacpacPath}.", dacpacPath);
}

var options = resource.GetDacpacDeployOptions();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ string IResourceWithDacpac.GetDacpacPath()
var projectPath = projectMetadata.ProjectPath;
using var projectCollection = new ProjectCollection();

var attr = GetType().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>();
var attr = Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyConfigurationAttribute>();
if (attr is not null)
projectCollection.SetGlobalProperty("Configuration", attr.Configuration);

Expand Down

0 comments on commit a80a229

Please sign in to comment.