locked
When I press F5 in one solution I run another solution. How to run the right solution? RRS feed

  • Question

  • User-589702765 posted

    I am using VS2013 Prof. I have copy/pasted a solution.
    My problem is that when I press f5 in the new solution (the copy) I am actually running the original solution.
    How to get in touch with my copy. So that IT will run when I press f5?

    I once had the same problem in VS2012, at that time I was able to hook up with the right solution by selecting "Use visual studio Development Server", but apparently that obtion is no longer available in VS2013.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/23e70e79-970d-423f-b434-12681b88ef2c/visual-studio-2012-debug-runs-old-code?forum=vsdebug

    Thursday, May 29, 2014 1:54 PM

Answers

  • User-1454326058 posted

    Hi rune007,

    I think it is the website project, please just open that website in a new solution. The solution file contains the configure information of website. So, if you copy all files of that solution is uses old information.

    1. Copy the website project folder to other location
    2. Open VS=>File=>New=>Project=>Other Project Types=>Visual Studio Solutions, then create a empty solution
    3. Right click the solution=>Add=>Existing Web site=>Select that website folder=>Open
    4. Build that solution

    On the other hand, as far as I know, Visual Studio Development Server has been removed from VS2013. VS2013 uses the IIS Express as the default web server. So there isn’t the use visual studio Development server option in the context when you right click the website project.

    If you want to use other server, please follow up these steps below:

    1. Right click your website project in the VS=>Select Property Pages
    2. Select Start Options
    3. Change the server in the Server section.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 30, 2014 5:42 AM
  • User281315223 posted

    Do you have any specific settings that have been applied within the Properties for your solution that might affect which applications are run (perhaps under the Web section)?

    Do you have multiple projects within this solution? The Set as Startup option should be working in either Visual Studio 2012 or 2013.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 30, 2014 8:10 AM
  • User281315223 posted

    Just to make sure, when you are copy/pasting the application are you doing it within Visual Studio or simply within the File Explorer? Additionally are you sure that both applications aren't simply targeting the same port?

    I have a feeling that something is possibly going wrong when you are copy/pasting your project as I wasn't able to reproduce your issue. Any additionally details that you could provide would be helpful (are these being copied in the same solution, the copying process, etc.)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 1, 2014 9:34 AM
  • User-589702765 posted

    Again thank you for your assistance.

    @Rion Williams - When I copied the solution, I simply right clicked the solution folder and chose copy, and then I pasted it somewhere else.

    Both the original and the copy was using the same Project URL http://localhost:61522/ This maybe explains why I could press f5 in one app and see the other app running?

    Anyway when I went Project -> Properties -> Web -> Project Url, and chose some new URLs for original app and copy app:
    http://localhost:61523/
    http://localhost:8080/
    I was able to press f5 for the different apps and always run the one I chose.
    So that is something one can do if one run another apps code when one presses f5.

    In VS2012, when project is set to use Visual Studio Development Server, I would always be running the right app, so that was perhaps a little easier?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 2, 2014 2:36 PM

All replies

  • User-425639139 posted

    As far as i understand your problem you should try the following things :

    Right Click on the Project in Visual Studio that you want to run as default and Select "Set as Startup Project" 

    if the above doesnt work Right Click on the project properties and set the startup page there

    Thursday, May 29, 2014 4:04 PM
  • User281315223 posted

    You'll need to ensure that the solution that you want to run is set as your default Startup application. 

    You can do this by right-clicking on the project that you want to run by default and choosing the "Set as Startup Project" option :

    If you need to run multiple projects, simply right-click on your Solution and choose the "Set Startup Projects" option :

    This will allow you to identify one or more projects that will be launched when you run your Project using F5.

    Thursday, May 29, 2014 4:09 PM
  • User-589702765 posted

    Thank you for your reponses :)
    Seems to work now.

    Friday, May 30, 2014 4:11 AM
  • User-589702765 posted

    I still have the problem.

    It's an VS2012 solution which I open with VS2013.

    So I have copy/pasted this solution, but when I run the copy, it's actually the original I am running.
    Even Select "Set as Startup Project" has no effect.

    The only thing, so far, which solves my problem is if I open the solution with VS2012 instead of VS2013, then I am able to debug the right project (the copy and not the original).

    As said I encountered this problem before with VS2012, and the solution then was "Use visual studio Development Server".
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/23e70e79-970d-423f-b434-12681b88ef2c/visual-studio-2012-debug-runs-old-code?forum=vsdebug

    Friday, May 30, 2014 4:38 AM
  • User-1454326058 posted

    Hi rune007,

    I think it is the website project, please just open that website in a new solution. The solution file contains the configure information of website. So, if you copy all files of that solution is uses old information.

    1. Copy the website project folder to other location
    2. Open VS=>File=>New=>Project=>Other Project Types=>Visual Studio Solutions, then create a empty solution
    3. Right click the solution=>Add=>Existing Web site=>Select that website folder=>Open
    4. Build that solution

    On the other hand, as far as I know, Visual Studio Development Server has been removed from VS2013. VS2013 uses the IIS Express as the default web server. So there isn’t the use visual studio Development server option in the context when you right click the website project.

    If you want to use other server, please follow up these steps below:

    1. Right click your website project in the VS=>Select Property Pages
    2. Select Start Options
    3. Change the server in the Server section.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 30, 2014 5:42 AM
  • User281315223 posted

    Do you have any specific settings that have been applied within the Properties for your solution that might affect which applications are run (perhaps under the Web section)?

    Do you have multiple projects within this solution? The Set as Startup option should be working in either Visual Studio 2012 or 2013.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 30, 2014 8:10 AM
  • User-589702765 posted

    Thank you for your replies guys! I have made a little test which again proves my point, there is something a little fishy between VS2012, and VS2013, probably it's because VS2013 doesn't support Visual Studio Development Server. If you do the sequence below, I would think you will experience what I am talking about. I have just done it.

    1. Create MVC 4 app in VS2012 (App_One), set it to use Visual Studio Development Server.
    -> Project
    -> Properties
    -> Web
    -> Use Visual Studio Development Server

    2. In App_One, set the ViewBag.Message = "Original".

    3. Copy/paste App_One and name the folder of the copy app, App_Two. In App_Two, set the ViewBag.Message = "Copy".

    4. Open App_One in VS2013 and run it.

    5. Open App_Two in VS2013 and run it. When you run App_Two, now, you will notice that you are actually not running App_Two, you are running App_One!!!

    Saturday, May 31, 2014 9:42 AM
  • User281315223 posted

    Just to make sure, when you are copy/pasting the application are you doing it within Visual Studio or simply within the File Explorer? Additionally are you sure that both applications aren't simply targeting the same port?

    I have a feeling that something is possibly going wrong when you are copy/pasting your project as I wasn't able to reproduce your issue. Any additionally details that you could provide would be helpful (are these being copied in the same solution, the copying process, etc.)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 1, 2014 9:34 AM
  • User-589702765 posted

    Again thank you for your assistance.

    @Rion Williams - When I copied the solution, I simply right clicked the solution folder and chose copy, and then I pasted it somewhere else.

    Both the original and the copy was using the same Project URL http://localhost:61522/ This maybe explains why I could press f5 in one app and see the other app running?

    Anyway when I went Project -> Properties -> Web -> Project Url, and chose some new URLs for original app and copy app:
    http://localhost:61523/
    http://localhost:8080/
    I was able to press f5 for the different apps and always run the one I chose.
    So that is something one can do if one run another apps code when one presses f5.

    In VS2012, when project is set to use Visual Studio Development Server, I would always be running the right app, so that was perhaps a little easier?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 2, 2014 2:36 PM