I created a new solution with a SQL Server Database Project (.sqlproj). I then 
created a target.proj in the same directory where my sample.sqlproj exists:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"; ToolsVersion="4.0">
  <ItemGroup>
    <ProjectReference Include="sample.sqlproj">
      <Name>sample</Name>
      <Project>{bd7cc11d-9e34-4d5f-b9db-7bc91549b53b}</Project>
      <Private>True</Private>
      <DoNotHarvest>True</DoNotHarvest>
      
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
      <RefTargetDir>INSTALLLOCATION</RefTargetDir>
    </ProjectReference>
  </ItemGroup>
  <Target Name="ShowTargetPath">
    <MSBuild Projects="@(ProjectReference)" Targets="GetTargetPath">
      <Output TaskParameter="TargetOutputs" ItemName="TargetOutput"/>
    </MSBuild>
    <Message Text="ShowTargetPath: %(TargetOutput.FullPath)" Importance="high"/>
  </Target>
  <Target Name="ShowSqlTargetPath">
    <MSBuild Projects="@(ProjectReference)" Targets="GetSqlTargetPath">
      <Output TaskParameter="TargetOutputs" ItemName="SqlTargetOutput"/>
    </MSBuild>
    <Message Text="ShowSqlTargetPath: %(SqlTargetOutput.FullPath)" 
Importance="high"/>
  </Target>
</Project>

Notice that I'm calling GetTargetPath and GetSqlTargetPath. I found looking 
through the imports in sample.sqlproj that they define both GetTargetPath and 
GetSqlTargetPath. Here is the output of using my target.proj:

PS D:\svn\sample\sample> 
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 
D:\svn\sample\sample\target.proj /t:"ShowTargetPath;ShowSqlTargetPath"
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.269]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 8/27/2012 10:22:34 AM.
Project "D:\svn\sample\sample\target.proj" on node 1 
(ShowTargetPath;ShowSqlTargetPath target(s)).
ShowTargetPath:
  ShowTargetPath: D:\svn\sample\sample\bin\Debug\sample.dll
ShowSqlTargetPath:
  ShowSqlTargetPath: D:\svn\sample\sample\bin\Debug\sample.dacpac
Done Building Project "D:\svn\sample\sample\target.proj" 
(ShowTargetPath;ShowSqlTargetPath target(s)).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.19

The sample.dacpac output is the main project output which is used to deploy a 
database. I can use a tool called sqlpackage.exe to deploy a .dacpac.

I'm not sure why sample.sqlproj responds with the path to sample.dll when 
GetTargetPath is called.

Interestingly enough, I see that building the project does in fact generate a 
sample.dll!

PS D:\svn\sample\sample> 
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 
D:\svn\sample\sample\sample.sqlproj /t:build
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.269]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 8/27/2012 10:28:44 AM.
Project "D:\svn\sample\sample\sample.sqlproj" on node 1 (build target(s)).
GenerateSqlTargetFrameworkMoniker:
Skipping target "GenerateSqlTargetFrameworkMoniker" because all output files 
are up-to-date with respect to the input files.
CoreCompile:
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig 
/nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE 
/reference:"C:\Program Files (x86
  )\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" 
/debug+ /debug:full /optimize- /out:obj\Debug\sample.dll /target:library 
/warnaserror- "C:\Users\e
  gcastro\AppData\Local\Temp\1\.NETFramework,Version=v4.0.SqlClrAttributes.cs"
SqlBuild:
  Creating a model to represent the project...
  Loading project references...
  Loading project files...
  Building the project model and resolving object interdependencies...
  Validating the project model...
  Writing model to D:\svn\sample\sample\obj\Debug\Model.xml...
CopyFilesToOutputDirectory:
  Copying file from "obj\Debug\sample.dll" to "bin\Debug\sample.dll".
  sample -> D:\svn\sample\sample\bin\Debug\sample.dll
  Copying file from "obj\Debug\sample.pdb" to "bin\Debug\sample.pdb".
SqlPrepareForRun:
  sample -> D:\svn\sample\sample\bin\Debug\sample.dacpac
Done Building Project "D:\svn\sample\sample\sample.sqlproj" (build target(s)).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.70

Edwin G. Castro
Software Developer - Staff
Digital Channels
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail

> -----Original Message-----
> From: Bob Arnson [mailto:b...@joyofsetup.com]
> Sent: Sunday, August 26, 2012 7:46 AM
> To: wix-users@lists.sourceforge.net
> Subject: Re: [WiX-users] FW: WiX using with MSBuild can't reference other
> project: error CNDL0150: Undefined preprocessor variable
> 
> On 8/24/2012 12:29 AM, Castro, Edwin G. (Hillsboro) wrote:
> > A .sqlproj is a new project type that can be created after the SQL Server
> Data Tools are installed.
> Run 'msbuild /t:GetTargetPath proj.sqlproj' to see if it supports the stock
> flow.
> 
> --
> sig://boB
> http://joyofsetup.com/
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to