locked
Defined configuration issue when deploying a multi project solution RRS feed

  • Question

  • I created a solution containing a database project and defined my custom configurations.
    I then added a to my solution project containing the server configuration (login, certificates...).
    whithin the database project, I added a reference to the server project.

    Since I did this, I can't seem to be able to deploy using msbuild.  I keep receiving the message that my configuration is not found.

    If I go to the server project and select the configuration manager, the configuration I created in the database project is present whithin the databse project but not whithin the server project.  If I attempt to create the configuration in the server project as well, I receive a message this is not feasible because the configuration already exists.

    Is there a proper way to do this?
    Tuesday, February 9, 2010 10:15 PM

Answers

  • Unfortunately, this is a general issue with configuration management in Visual Studio.  Any new project will not automagically have configurations added for all configurations in the solution.  From the configuration manager, you will need to select the appropriate solution configuration, then create a the new configuration for the newer projects.  Be sure that you uncheck the option for "Create a new solution configurations" so you can use a common name to the solution configuration.

    The issue from msbuild probably stems from this, but I need a little more info.  Are you building\deploying the solution or the database project?  I assume you are providing a particular configuration override?  If you are building the solution, it should have a mapping consistent with that you would see in configuration manager, so it should work.  If you are building the database project and providing a configuration, msbuild will try to match the configuration of the referenced server project to that you provided on the command line.  If it doesn't exist, I would expect that it will default to either Debug or Release.  If those exist and it isn't defaulting, then that is likely a bug.  If none of the configurations exist, then it can't default and should error out.

    Andrew

    • Proposed as answer by Nantox Monday, February 15, 2010 8:33 PM
    • Marked as answer by Figo Fei Tuesday, February 16, 2010 4:32 AM
    Thursday, February 11, 2010 2:00 AM
  • Execution of the msbuild Deploy target will NOT deploy the dependencies, same as VSDBCMD.
    • Marked as answer by Antoine F Friday, February 19, 2010 3:35 PM
    Tuesday, February 16, 2010 9:03 PM
  • Deploying from the VS IDE will deploy all project dependencies.  Deploying from the command line or via VSDBCMD, will NOT deploy the dependencies.

    Also, it looks like msbuild from the command line doesn't do anything in regards to defaulting to a config.  Each referenced project must have the configuration declared on the command line.

    Andrew
    • Proposed as answer by Nantox Monday, February 15, 2010 8:33 PM
    • Marked as answer by Figo Fei Tuesday, February 16, 2010 4:32 AM
    Thursday, February 11, 2010 5:53 PM

All replies

  • Seems like something is getting really confused. I would try to open the server project in a standalone fashion and update the configuration information that way, and see if that helps. Not sure what else I would do in that case.
    GertD @ www.DBProj.com
    Wednesday, February 10, 2010 9:53 PM
  • Unfortunately, this is a general issue with configuration management in Visual Studio.  Any new project will not automagically have configurations added for all configurations in the solution.  From the configuration manager, you will need to select the appropriate solution configuration, then create a the new configuration for the newer projects.  Be sure that you uncheck the option for "Create a new solution configurations" so you can use a common name to the solution configuration.

    The issue from msbuild probably stems from this, but I need a little more info.  Are you building\deploying the solution or the database project?  I assume you are providing a particular configuration override?  If you are building the solution, it should have a mapping consistent with that you would see in configuration manager, so it should work.  If you are building the database project and providing a configuration, msbuild will try to match the configuration of the referenced server project to that you provided on the command line.  If it doesn't exist, I would expect that it will default to either Debug or Release.  If those exist and it isn't defaulting, then that is likely a bug.  If none of the configurations exist, then it can't default and should error out.

    Andrew

    • Proposed as answer by Nantox Monday, February 15, 2010 8:33 PM
    • Marked as answer by Figo Fei Tuesday, February 16, 2010 4:32 AM
    Thursday, February 11, 2010 2:00 AM
  • Thanks both.

    Andrew, the check box was indeed what prevented me from creating the configuration in my new project. 

    I was attempting to deploy database project.

    Before I try again, could you inform me of the following?  My database project references my server project.  If I deploy my database project, will data dude consider my server project as a dependency and deploy it as well since it can be found within the solution?

    I'll answer your question  and clarify but I believe being able to create the configuration will allow me to get a little further.  Just want to make sure I won't overwrite my server by deploying a database.

    The error was at build.
    calling msbuild, I specify the configuration which is a custom one (one I created using the configuration manager).
    I have overrides, not sure if this is what you want to kow but I edited the project file (dbproj) to receive parameters from the prompt and assign them to my sqlcmdvars using the override command.
    I did not remove the default configurations (debug, release)  The are therefore present in both projects but are not the one I specify at cmd prompt.
    The error I receive is about the configuration I created which is the one I specified at cmd prompt not being present.  I therefore assume the server project does not default to the default configurations (debug or release)
    Thursday, February 11, 2010 2:05 PM
  • Deploying from the VS IDE will deploy all project dependencies.  Deploying from the command line or via VSDBCMD, will NOT deploy the dependencies.

    Also, it looks like msbuild from the command line doesn't do anything in regards to defaulting to a config.  Each referenced project must have the configuration declared on the command line.

    Andrew
    • Proposed as answer by Nantox Monday, February 15, 2010 8:33 PM
    • Marked as answer by Figo Fei Tuesday, February 16, 2010 4:32 AM
    Thursday, February 11, 2010 5:53 PM
  • Andrew, do you know if msbuild behaves the same way as vsdbcmd i.e. deploying only the specified project, not the dependencies?

    Thanks for the help.
    Tuesday, February 16, 2010 6:27 PM
  • Execution of the msbuild Deploy target will NOT deploy the dependencies, same as VSDBCMD.
    • Marked as answer by Antoine F Friday, February 19, 2010 3:35 PM
    Tuesday, February 16, 2010 9:03 PM
  • Thanks Andrew.  I succesfully deployed it.

    One thing which drew my attention to lately is the matrix in the configuration manager.  There is a grid displaying check box with the project on the Y axis and the actions on the X axis.  It allows to remove the deploy operation from the project I do not want to deploy.
    Friday, February 19, 2010 3:35 PM