locked
Setting StartAction for a Web Application Project in the csproj RRS feed

  • Question

  • Banging my head against a brick wall on this one.

    I want to create a template for a web application project that will have a preconfigured StartAction of Program so that hitting F5 will launch a custom tool rather than the web page / WCF test client and the debugger will automatically be attached to IIS.

    When I set the options through Project properties, they get set in the csproj.user file. This is not want i want as it won't be under source control and I can't unfold it from a template. If I move these settings to the same place in the csproj schema then VS ignores them altogether.

    Any ideas?
    Monday, March 1, 2010 3:40 AM

Answers

  • Hi PeteGoo,

    Based on my understanding, you are creating a project template, and you want to set the default start action. If so, you don't need to worry about csproj.user file. It's related to your Visual Studio, but not related to csproj.user. If you want to reuse this custom project template in other Visual Studio, you can export this template from Visual Studio, for more information, please see:

    How to create a reusable custom Project Template for VS.NET 2005
    http://www.codeproject.com/KB/vb/VSNet_Project_Template.aspx

    About setting default StartAction for custom project template, see code below:

    public void ProjectFinishedGenerating(Project project)
    {
      foreach (Configuration config in project.ConfigurationManager)
      {
        config.Properties.Item("StartAction").Value = 1; //Launch external program
        config.Properties.Item("StartProgram").Value = <pathToYourEXE>;
        config.Properties.Item("StartArguments").Value = <argumentsToYourExe>;
      }
    }
    For details, see:

    VSX: Custom Package’s Project Type to mimik “Debug >> Start Action >> Start External Program

    If I misunderstood you, or you have any comments, please update this thread.

    Best Regards,
    Nancy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Monday, March 8, 2010 3:14 AM
    Wednesday, March 3, 2010 9:47 AM

All replies

  • Hi PeteGoo,

    Based on my understanding, you are creating a project template, and you want to set the default start action. If so, you don't need to worry about csproj.user file. It's related to your Visual Studio, but not related to csproj.user. If you want to reuse this custom project template in other Visual Studio, you can export this template from Visual Studio, for more information, please see:

    How to create a reusable custom Project Template for VS.NET 2005
    http://www.codeproject.com/KB/vb/VSNet_Project_Template.aspx

    About setting default StartAction for custom project template, see code below:

    public void ProjectFinishedGenerating(Project project)
    {
      foreach (Configuration config in project.ConfigurationManager)
      {
        config.Properties.Item("StartAction").Value = 1; //Launch external program
        config.Properties.Item("StartProgram").Value = <pathToYourEXE>;
        config.Properties.Item("StartArguments").Value = <argumentsToYourExe>;
      }
    }
    For details, see:

    VSX: Custom Package’s Project Type to mimik “Debug >> Start Action >> Start External Program

    If I misunderstood you, or you have any comments, please update this thread.

    Best Regards,
    Nancy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Monday, March 8, 2010 3:14 AM
    Wednesday, March 3, 2010 9:47 AM
  • Yes, thanks,

    This is actually what I ended up doing anyway.

    Thanks again,
    Pete
    Monday, March 8, 2010 5:26 AM
  • Banging my head against a brick wall on this one.

    I want to create a template for a web application project that will have a preconfigured StartAction of Program so that hitting F5 will launch a custom tool rather than the web page / WCF test client and the debugger will automatically be attached to IIS.

    When I set the options through Project properties, they get set in the csproj.user file. This is not want i want as it won't be under source control and I can't unfold it from a template. If I move these settings to the same place in the csproj schema then VS ignores them altogether.

    Any ideas?

    Is there an rignt answer for the problem? 
    Friday, January 7, 2011 1:30 AM
  • Banging my head against a brick wall on this one.

    I want to create a template for a web application project that will have a preconfigured StartAction of Program so that hitting F5 will launch a custom tool rather than the web page / WCF test client and the debugger will automatically be attached to IIS.

    When I set the options through Project properties, they get set in the csproj.user file. This is not want i want as it won't be under source control and I can't unfold it from a template. If I move these settings to the same place in the csproj schema then VS ignores them altogether.

    Any ideas?

    Is there an rignt answer for the problem? 
    Friday, January 7, 2011 1:39 AM