pasunsky.blogg.se

Change the start page in visual studio for mac
Change the start page in visual studio for mac















Normally, when you run an ASP.NET MVC application by hitting F5 and opening a new browser window, you must close the browser window when you stop debugging. You can keep your MVC application open at all times (even when debugging). What’s the advantage of running your MVC application in this strange way? The chief advantage is that you can keep your browser window open on a particular page. After you start running your application, you can view it by opening a new browser from the ASP.NET Development Server (see Figure 2). (4) Save your new changes by clicking the icon of the floppy.Īfter you make these modifications, executing Debug, Start Debugging or executing Debug, Start without Debugging will not open a new browser window. (3) Change the Enable Edit and Continue setting to enable it.

change the start page in visual studio for mac

(2) Change the Start Setting to Don’t open a page. (1) Navigate to the settings for your project’s Start Action by right-clicking your project, selecting Properties, and selecting the Web tab. The recommendation is that you open your browser window once and keep it open while developing a website.įigure 2 – Running from the ASP.NET Development Web Server He recommends that you run your ASP.NET MVC application by right-clicking the ASP.NET Development Server icon in the notification area of the Taskbar and selecting Open in Web Browser (see Figure 2). I originally got the following tip from Brian Henderson. Running from the ASP.NET Development Server For example, you can set a breakpoint, hit the breakpoint, modify your code, and click the Continue button and the new changes will take effect.

#Change the start page in visual studio for mac code#

If you enable it, then you can modify code in your application while debugging your application. The most interesting setting in this section is the Enable Edit and Continue setting. This section appears only for ASP.NET MVC Web Application and ASP.NET Web Forms Applications, but not for ASP.NET Web Sites. For example, if you want to request the URL /Product/Show/23 when your application starts, then you can enter this URL into the Specific Page input field. Notice that you can change the start page for an ASP.NET MVC Application to a particular page. If you have a particular page open in Visual Studio then that page will run. If you run an ASP.NET MVC application, the application will always run the default page (the path /).Īn ASP.NET Web Forms application, in contrast, has the Current Page option selected by default. Don’t open a page – Enables you to do nothing.īy default, an ASP.NET MVC application has the Specific Page option selected.This option is typically used when building a Web Services application. Start URL – Enables you to request a URL.Start External Program – Enables you to run an external program.You can set the page here or you can right-click a page in the Solution Explorer window and select the menu option Set As Start Page. Specific Page – Enables you to set a particular page to run.Current Page – Enables you to run the page currently open for editing in Visual Studio.The Start Action section enables you to specify what happens when you run an application. There are two sections that you can modify. Select the Web tab to view the Start Options (see Figure 1).

change the start page in visual studio for mac

Right-click your project in the Solution Explorer window and select the menu option Properties. You can control what happens when you hit F5 or Ctl-F5 by modifying your ASP.NET MVC project’s Start Action settings. However, the real path, determined by the URL Routing module, could be anything. Most likely, the real path is /Home/Index.aspx. The problem is that the path ViewsHomeIndex.aspx does not correspond to the real path for viewing the Index view. For example, if you have a file with the path ViewsHomeIndex.aspx open in Visual Studio, and you hit F5 to run your application, then you don’t want the Index.aspx to open in the web browser. Typically, you do not want to open the current page in the web browser. It’s up to the Index() method to decide what view, if any, to return to the browser.įor this reason, running an ASP.NET MVC application can be trickier than running a normal ASP.NET Web Forms application. The Routing module used by ASP.NET MVC, by default, will route this request to a controller named ProductController and invoke the ProductController’s Index() method. There is no reason to assume that an ASP.NET MVC application contains a Product folder or that the Product folder contains a file named Index.aspx. For example, imagine that you request the following URL: When you request a URL, there might not be a corresponding page on your hard drive.

change the start page in visual studio for mac

I recommend that you run an ASP.NET MVC application directly from the ASP.NET Development Web Server.Īn ASP.NET MVC application works differently than a normal ASP.NET Web Forms application. In this tip, I explain the different options for running an ASP.NET MVC application from Visual Studio 2008.















Change the start page in visual studio for mac