Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet publish does not work when DACPAC output name is changed #68

Closed
RVink opened this issue Sep 30, 2020 · 2 comments · Fixed by #77
Closed

Dotnet publish does not work when DACPAC output name is changed #68

RVink opened this issue Sep 30, 2020 · 2 comments · Fixed by #77
Assignees
Labels
bug Something isn't working

Comments

@RVink
Copy link
Member

RVink commented Sep 30, 2020

As described in #65 it's possible to change the name of the DACPAC output by setting the AssemblyName in the project file. However changing the output name breaks the dotnet publish command. This is because the publish command tries to use the DACPAC file based on the project name.

C:\Users\rvink\.nuget\packages\msbuild.sdk.sqlproj\1.7.0\Sdk\Sdk.targets(199,5): error MSB3073: The command "dotnet "C:\Users\rvink\.nuget\packages\msbuild.sdk.sqlproj\1.7.0\Sdk\../tools/netcoreapp3.1/DacpacTool.dll" deploy -i "C:\Users\rvink\source\repos\TestProject\TestDatabase\bin\Debug\netstandard2.0\/TestDatabase.dacpac" -tsn "(local)" -tdn "RandomDatabaseName" -p CreateNewDatabase=False -p IncludeCompositeObjects=true " exited with code 1. [C:\Users\rvink\source\repos\TestProject\TestDatabase\TestDatabase.csproj]

This is my project file:

<Project Sdk="MSBuild.Sdk.SqlProj/1.7.0">
    <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
        <SqlServerVersion>Sql140</SqlServerVersion>
	<AssemblyName>RandomDatabaseName</AssemblyName>
	<TargetDatabaseName>RandomDatabaseName</TargetDatabaseName>
        <!-- For additional properties that can be set here, please refer to https://github.com/rr-wfm/MSBuild.Sdk.SqlProj#model-properties -->
    </PropertyGroup>

    <PropertyGroup>
        <!-- Refer to https://github.com/rr-wfm/MSBuild.Sdk.SqlProj#publishing-support for supported publishing options -->
    </PropertyGroup>
</Project>
@brettrowberry
Copy link
Contributor

brettrowberry commented Sep 30, 2020

I just observed the same thing. I guess I tried building but not publishing when I added AssemblyName.

I'm documenting my thoughts here.

dotnet build works when the following are defined:

  • AssemblyName
  • TargetDatabaseName
  • both AssemblyName and TargetDatabaseName
  • neither

dotnet publish works when the following are defined:

  • TargetDatabaseName
  • neither

dotnet publish does not work when the following are defined:

  • AssemblyName
  • both AssemblyName and TargetDatabaseName

@brettrowberry
Copy link
Contributor

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants