none
Deploy to wrong server? RRS feed

  • Question

  • I have what I think should be a simple question.

    I want to deploy my solution, that contains among other projects, several SqlServer Projects from my TestServer to the ProductionServer.
    I copy my project sources from the TestServer to the ProductionServer. Next I replace all "Data Source=TestServer" to "Data Source=ProdServer" and all "Initial Catalog=TestDb" to "Initial Catalog=ProdDb".

    Sure enough the Database Reference in the Database Tab of the Project has changed from Test to Prod.
    Strangely though if I deploy this solution the Assemblies are created on the TestServer instead of the ProdServer.

    Only when I take the TestServer.TestDb offline I am prompted to alter the database connection. Then it deploys to the altered connection, which I alter to PROD of course.

    So my simple question is. Where is connection string comming from? After all I replaced all Test to Prod, including the connection string in the Database Tab of the SqlServer Database project.

    Hope you can help


    I'll be back

    Monday, July 2, 2012 8:41 AM

All replies

  • Hi Josje,

    Thank you for posting on this forum.

    Based on your description, please try to make an application setting for the connection string, so when you need to change to another connection string, just change the config file.

    Here, my suggestion is to check your config file, it seems that you have used the  settings.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 3, 2012 10:19 AM
    Moderator
  • Hi Mike,

    I have altered the connection string in the app.config files, but perhaps you are talking about a different config file?

    Since I have to deploy the production solution from the TestServer (there is no proper version of Visual Studio on the ProdServer) perhaps there is where the problem is. Perhaps you mean the config file for Visual Studio rather than th config file of the solution?

    If so where is this config file located?

    Regards, Jos


    I'll be back

    PS: I am getting these errors after taking offline the TestDb (Baanstede_Test) on the TestServer(ONTW01) after loading the solution from the ProdServer(APP04) trying to create the assemblies in the ProdDb(Baanstede_Prod)

    ------ Build started: Project: Baanstede, Configuration: Production Any CPU ------
    Baanstede -> R:\ProjectenJosProd\BaanstedeSql\Baanstede\bin\Production\Baanstede.dll
    REM If Production==CLR_Debug (Copy "R:\ProjectenJosProd\BaanstedeSql\Baanstede\bin\Production\Baanstede.dll" "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Baanstede.dll")
    ------ Build started: Project: BaanstedeSql, Configuration: Production Any CPU ------
    BaanstedeSql -> R:\ProjectenJosProd\BaanstedeSql\BaanstedeSql\bin\Production\BaanstedeSql.dll
    ------ Build started: Project: BaanstedeIw3, Configuration: Production Any CPU ------
    BaanstedeIw3 -> R:\ProjectenJosProd\BaanstedeSql\BaanstedeIw3\bin\Production\BaanstedeIw3.dll
    ------ Build started: Project: BaanstedeOffice, Configuration: Production Any CPU ------
    BaanstedeOffice -> R:\ProjectenJosProd\BaanstedeSql\BaanstedeOffice\bin\Production\BaanstedeOffice.dll
    ------ Build started: Project: BaanstedeOplevering, Configuration: Production Any CPU ------
    BaanstedeOplevering -> R:\ProjectenJosProd\BaanstedeSql\BaanstedeOplevering\bin\Production\BaanstedeOplevering.exe
    ------ Build started: Project: BaanstedeTst, Configuration: Production Any CPU ------
    BaanstedeTst -> R:\ProjectenJosProd\BaanstedeSql\BaanstedeTst\bin\Production\BaanstedeTst.exe
    ------ Deploy started: Project: Baanstede, Configuration: Production Any CPU ------
    Error: starting database upload transaction failed.
    Error: The operation could not be completed 
    ------ Deploy started: Project: BaanstedeSql, Configuration: Production Any CPU ------
    Error: starting database upload transaction failed.
    Error: The operation could not be completed 
    ------ Deploy started: Project: BaanstedeIw3, Configuration: Production Any CPU ------
    Error: starting database upload transaction failed.
    Error: The operation could not be completed 
    ========== Build: 6 succeeded or up-to-date, 0 failed, 0 skipped ==========
    ========== Deploy: 0 succeeded, 3 failed, 0 skipped ==========
    

    • Edited by Josje Friday, July 6, 2012 6:58 AM
    Friday, July 6, 2012 6:54 AM
  • Hi Josje,

    I indeed mean the config file fo solution, not the one of VS.

    For the deploy error, please take a look at this KB: http://support.microsoft.com/kb/2011805 

    For your previous question, I would suggest you to check your code again, it doesn't make sense when there is no test connection string, but the application keeps use it.

    I would suggest you try to check how do you get the connection string one line code by one line code. 

    Do you always get it from config file? No hard code? Didn't read it from other common file? Didn't retrieve it from another database?

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike FengModerator Friday, July 13, 2012 9:22 AM
    • Unmarked as answer by Josje Monday, July 30, 2012 7:58 AM
    Friday, July 6, 2012 7:30 AM
    Moderator