'View in Browser' with Razor and MVC in Visual Studio - asp.net-mvc

I'm currently playing with Razor and MVC in VS 2017, but, unlike aspx pages, I can't simply view in browser to see what it looks like when rendered, instead I have to copy it to the host and view it live on the internet.
Is there a way to view in browser without publishing it remotely?
Thanks

In Visual Studio, from the main menu select:
View -> Toolbars -> Standard (Make sure Standard is checked)
Just below the main menu, you should see a row, or many rows, of icons. You want to look for a green arrow icon. After locating the green arrow and clicking on it, Visual Studio will attempt to first build your project, which if successful, will then proceed to run your project in localhost. If it doesn't build you will be notified and you can review the Error List tab at the bottom of Visual Studio as to the reasons why.
After a successful build, Visual Studio will open your default browser automatically and redirect itself to the localhost and port number of where your application is running. You should now see your application running. It will have a url in the browser something similar to the following https://localhost:5000/

Related

How can I stop Visual Studio 2019 from changing the start up page whenever I click in solution explorer?

There are many aspects of Visual Studio which are irritating, but one of the most frustrating is that the start page changes whenever a page or folder is clicked in the solution explorer. When the start page is set it should stay as the start page unless the user specifically changes it. What is the point of having 'Set as start page' in the right-click menu if you can do this just by clicking the folder or page?
I'm fed up of constantly having to correct the start page every time I want to run the code. Does anybody know if there is a way to fix this behaviour?
Edit: Looks like it's not just clicking in solution explorer that does this, but clicking an open file as well

Visual Studio 2019 and Git Update View Problem

I'm developing a ASP.Net MVC 5 application using Visual Studio 2019. I also am using Git and GitHub with this project (first time - previously I have used TortoiseSVN).
I've noticed that when I make a change to a Razor View, a red tick will appear beside the file in Visual Studio to signify that something has changed within the View.
However, I can only see the changes I've made within the View if I stop debugging, and then restart. Normally I could make a change to the Razor View whilst debugging, e.g. a text change, Save the Razor View within Visual Studio, and then F5 or Ctrl F5 within the browser and the page with refresh with the latest text change.
For some reason I believe this is related to Git because I have other MVC 5 applications on my laptop within the same folder structure which are not using Git, and this problem does not exist.
Surely I don't have to stop debugging and restart every time I want to see a change to a View?
Could someone please help?
Thanks.

Can't user Custom Work Item Form in TFS 2018 Web portal

I'm creating new User Story (WIT), I have installes tool: Process Editor under VS2018, connected to the project and exported WIT ( User Story ) then i have made some changes. While using previe window under VS2019 i see that changes has been made:
But while using Web portal i can't see my changes, there is only default Agile User Story view:
I have found information what could be the problem ( Enable the new form found on M$): https://learn.microsoft.com/en-us/azure/devops/reference/manage-new-form-rollout?view=tfs-2017&viewFallbackFrom=azure-devops
I've checked all permissions and groups I'm in, inclding Administrator groups, for projects, whole collection ext. On the M$ web site is information that i should click "Enable the new work item form" to be able to use customization i did. But i don't have this option :( :
Can you please tell me what Am I doing wrong ? What have I missed ?
TFS2018 installed on premise.
Thanks.
Please take a look at this ticket: TFS work items opened inside Visual Study no longer open in the web browser, they always open in the Visual Studio editor
According to the response from MSFT:
We have re-design the default landing page for work items in Visual
Studio 2019 which only works with server >= 2019. If server is <
2019, work items will be open in Visual Studio only.
Since you are using TFS 2018 with VS2019, you may have to open work item in web portal from browser directly right now.
But work item in Visual Studio IDE is still using the old Layout forms. Work item in Web Portal is using the new layout. That's why you have seen different behavior.
The using of the new work item form is already updated in your server. On VS you see the old style but on web you have the new style. On the Process editor download page you can find the following:
Process Template: Open and edit a process template (you can only edit
the old-style work item forms, those that don’t reflect the new web
layout)
To update the new form check this page: New web form layout-WebLayout and Control elements

"edit, build, refresh browser" approach in visual studio 2017

New_bie_developer_from_php_background.
I am developing an asp.net MVC web app using vs2017 community edition.
I want to make my development environment in such a way that I can edit code, build and refresh the browser to see the changes and again you can edit without stopping the server.
But in VS the approach is different. You have to stop the server, edit code, start server again (which makes the server code uneditable).
Does the vs can be modified to match my requirements? ie to edit, build and refresh the browser.
Partial solution can be to start your app in a Launch without Debug mode (Ctrl+F5).
That way, ASP.NET will be automatically picking up changes you are making in your code. However, in this mode you will lose debug features (hitting breakpoints, getting debug-related messages etc.).
There are two ways to do this. First is to click on pause
or use keyboard shortcut keys (Ctrl+Alt+Break). Edit your code and click continue.
Second is by go to Properties of your project (by right clicking project in visual studio's solution explorer) => select Web from left nav and check the Enable Edit and Continue checkbox. Now you can add break point and when it get hit you can edit your code. Now Refresh your browser.

How to View a TFS Work Item in MS Project in a Visual Studio-like Form

I'm using MS Project to manage my TFS work items. The standard Summary Task Information window that comes up when double-clicking on a task is slightly inadequate when dealing with TFS work items. It lacks the standard work item view that we're accustomed to within Visual Studio, and that MS has elegantly rendered within visualstudio.com.
I noticed today that if I set a task field to invalid value, then Work Item Publishing Errors window comes up and there's a nifty little button Edit Work Item... that displays the work item in the standard VS view. Now I'm searching all over Project to figure out how to edit a work item in this view without first having to cause a publishing error. There must be some button I've overlooked in Project that opens a TFS work item up in the VS-like view, isn't there?
It's currently not possible and its also not intended to be used that way. The UI in Ms Project is the native Project UI and is mant to receive the updates to the plan and to layout the items into a new plan.
Managing the contents of the items is all meant to be done from the Web UI. With the new Work Item UI you'll be redirected to the Web whenever you need to edit a work item. Visual Studio, Excel and Project won't show you a native editor window anymore.
You'll be able to directly to the work item editor on the web from the team tab. When connecting to older versions of TFS, this would open the Work Item editor:

Resources