locked
Rename SQLCMDVARS causes release build to fail.

    Question

  • Hi all,

    I have successfully been using data dude for a while now. However recently we add two database to a single solution. These caused the sqlcmdvars and .sqldeployment files etc to overwrite each other.

    i.e.

    first db project would compile and drops to $(TeamBuildOutDir)

    2nd project would compile and drop same files in same location effectively overwriting the previously compiled db's files.

    to work around this I renamed the 4 main control files .sqlcmdvars .sqldeployment etc to another name. Such as database1.sqlcmdvars database2.sqlcmdvars and so on.

    This works fine on a debug build but release builds would fail due to the following error.

    "x:\Database1.dbproj" (default target) (16:6) ->
      C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(80,5): Build error TSD01237: The source file 'Properties\Database.sqlcmdvars' could not be opened ('X:\Properties\Database.sqlcmdvars ').
      C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets(80,5): Build error TSD01237: The source file 'Properties\Database.sqldeployment' could not be opened ('x:\Properties\Database.sqldeployment ').

    Note: paths above shortened for readability

    As you can see with the release build it tries to find the default filenames of Database.sqldeployment instead of the renamed items.

    Does anyone know why this occurs? A workaround would be to have only a single db per solution and compile separate into something like $(OutDir)=$(TeamBuildOutDir)\Database1.

    Is this a bug in here ? Microsoft.Data.Schema.SqlTasks.targets

     

    Friday, June 4, 2010 11:17 PM

Answers

  • This seems to be a bug with VS 2008 and .dbproj files.

    The rename option in the VS Gui does not rename the underlying dbproj file correctly. Here is the results of the .dbproj after rename. Does anyone know where to log a bug against VS?  Not sure if this is fixed in 2010?

     

    <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

        <DeploymentConfigFile>Properties\Database.sqldeployment</DeploymentConfigFile>
        <SqlCommandVariablesFile>Properties\Database.sqlcmdvars</SqlCommandVariablesFile>

      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

        <DeploymentConfigFile>Properties\Database_1.sqldeployment</DeploymentConfigFile>
        <SqlCommandVariablesFile>Properties\Database_1.sqlcmdvars</SqlCommandVariablesFile>

      </PropertyGroup>

    • Marked as answer by Figo Fei Thursday, June 17, 2010 8:53 AM
    Monday, June 7, 2010 12:01 AM

All replies

  • This seems to be a bug with VS 2008 and .dbproj files.

    The rename option in the VS Gui does not rename the underlying dbproj file correctly. Here is the results of the .dbproj after rename. Does anyone know where to log a bug against VS?  Not sure if this is fixed in 2010?

     

    <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

        <DeploymentConfigFile>Properties\Database.sqldeployment</DeploymentConfigFile>
        <SqlCommandVariablesFile>Properties\Database.sqlcmdvars</SqlCommandVariablesFile>

      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

        <DeploymentConfigFile>Properties\Database_1.sqldeployment</DeploymentConfigFile>
        <SqlCommandVariablesFile>Properties\Database_1.sqlcmdvars</SqlCommandVariablesFile>

      </PropertyGroup>

    • Marked as answer by Figo Fei Thursday, June 17, 2010 8:53 AM
    Monday, June 7, 2010 12:01 AM
  • Hi John,

    You may submit it through connect.microsoft.com

    Thanks.


    Figo Fei
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, June 16, 2010 2:56 AM