How to start a single project without debugging in

2019-01-10 18:37发布

My solution contains multiple projects which can be started. SometimesI would like to start a single project without using my solution startup projects settings. When I right-click on the project, I can navigate to Debug->Start New Instance, which starts the application with debugger.

But I would like to start a new instance without debugger. Is this possible?

14条回答
ら.Afraid
2楼-- · 2019-01-10 19:00

Someone has made an addon that does this. Currently doesn't really handle aspnetcore projects though:

https://marketplace.visualstudio.com/items?temName=vurdalak1.startwithoutdebugging

查看更多
【Aperson】
3楼-- · 2019-01-10 19:01

Use Start without debugging under Debug menu, or

Ctrl+F5

or you can modify the web.config file for the project:

<compilation debug="false"/>
查看更多
乱世女痞
4楼-- · 2019-01-10 19:01

This is pretty quick: Project | Set As StartUp Project | Current Selection. Then whichever project is selected is run under Debug | Start Without Debugging / Ctrl-f5. https://blogs.msdn.microsoft.com/saraford/2005/11/29/how-to-set-your-current-project-to-always-be-the-startup-project/

查看更多
Bombasti
5楼-- · 2019-01-10 19:01

Right-click on the solution, select Properties. Select Multiple startup projects. A combobox for each project allows you decide which projects to start without debugging.

查看更多
相关推荐>>
6楼-- · 2019-01-10 19:04

Add VSCommands extension into Visual Studio, right click a project -> Debug -> Start Without Debugging

查看更多
We Are One
7楼-- · 2019-01-10 19:05

I just put together this macro.. It's a combination of several snippets I found around the interweb. If the project is configured to run the default project output, it will find and run that. If it's configured to run a specific program, it will run that. This macro will NOT compile your application either, so you'll want to make sure it's compiled before you run the macro. At the same time, this macro doesn't suffer from the problem mentioned in Mahin's macro above.

Sub RunActiveProjectOutput()
    Dim Projs As Array
    Dim Proj As Project
    Projs = DTE.ActiveSolutionProjects()
    If (Projs.Length > 0) Then
        Proj = Projs.GetValue(0)

        Dim action = DirectCast(Proj.ConfigurationManager.ActiveConfiguration.Properties.Item("StartAction").Value, Integer)

        If (action = 1) Then
            Dim app = Proj.ConfigurationManager.ActiveConfiguration.Properties.Item("StartProgram").Value
            Dim args = Proj.ConfigurationManager.ActiveConfiguration.Properties.Item("StartArguments").Value
            System.Diagnostics.Process.Start(app, args)
        Else
            Dim fullPath = Proj.Properties.Item("FullPath").Value.ToString()
            Dim outputPath = Proj.ConfigurationManager.ActiveConfiguration.Properties.Item("OutputPath").Value.ToString()
            Dim outputDir = System.IO.Path.Combine(fullPath, outputPath)
            Dim outputFileName = Proj.Properties.Item("OutputFileName").Value.ToString()
            Dim assemblyPath = System.IO.Path.Combine(outputDir, outputFileName)
            System.Diagnostics.Process.Start(assemblyPath)
        End If
    End If
End Sub
查看更多
登录 后发表回答