MSBuild.Sdk.SqlProj icon indicating copy to clipboard operation
MSBuild.Sdk.SqlProj copied to clipboard

ArtifactReference dacpac without using cmdvariables

Open greektreat opened this issue 3 years ago • 5 comments

I have a private Nuget package that contains AppLog.dacpac. This adds our standard enterprise logging tables to the database. I am getting warnings stating "an unresolved reference to object" How do I add ArtifactReferences ? this dacpac will be deployed inside this sql database.

greektreat avatar Dec 24 '21 14:12 greektreat

I believe your use case is covered in our readme under the header Package References. In particular, you'll want something like the following:

    <ItemGroup>
      <PackageReference Include="MyDatabasePackage" Version="1.0.0" />
    </ItemGroup>

Let me know if I'm misunderstanding and this isn't what you're trying to do!

jeffrosenberg avatar Dec 24 '21 15:12 jeffrosenberg

I believe your use case is covered in our readme under the header Package References. In particular, you'll want something like the following:

    <ItemGroup>
      <PackageReference Include="MyDatabasePackage" Version="1.0.0" />
    </ItemGroup>

Let me know if I'm misunderstanding and this isn't what you're trying to do!

thanks jeff. I do have that, Also this is clarify it's just warning not errors <ItemGroup> <PackageReference Include="AppLog" Version="1.0.0" /> <PackageReference Include="TCC.Broker" Version="1.0.0.5" /> </ItemGroup>

2 examples: of this:

SQL71502 SqlProcedure: [dbo].[spInboundSherlockEventRequest] has an unresolved reference to object [tcc].[TransactionStageIn]

SQL71502 SqlProcedure: [dbo].[spInboundSherlockEventRequest] has an unresolved reference to object [app].[Log]

greektreat avatar Dec 24 '21 15:12 greektreat

Oh, sorry, I overlooked that these were warnings. There are 2 ways to suppress these:

  • Use the SuppressTSqlWarnings property in the project file
  • Use the /nowarn flag in MSBuild

jeffrosenberg avatar Dec 24 '21 16:12 jeffrosenberg

@greektreat Does the name of the NuGet package match the name of the .dacpac file contained within the package? I believe that is currently required for the <PackageReference> to work as expected.

jmezach avatar Dec 27 '21 08:12 jmezach

  • SuppressTSqlWarnings

sorry didn't respond. yes they are named the same

<ItemGroup>
    <PackageReference Include="AppLog" Version="1.0.0" />    
  </ItemGroup>

  <ItemGroup>
    <None Update="AppLog.dacpac">
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>      
    </None>
  </ItemGroup>

greektreat avatar Feb 10 '22 15:02 greektreat

@greektreat Can you share a full repro?

ErikEJ avatar Nov 22 '22 14:11 ErikEJ

Closing as the requested additional info was not provided. Feel free to re-open when you have it available.

ErikEJ avatar Dec 02 '22 13:12 ErikEJ