Desgin View Is Not Showing On Visual Studio-2017 - visual-studio

I am working on a project using Visual Basic(Programming language)on Visual Studio-2017 and when i first start my projects i get my design view like this:enter image description here,
Then when i save my work and re-open the project another time my desgin view is not showing up and it looks like this:enter image description here
Please help!! My desgin view apperars when i start a new project and when i save the project and come back to it another time it's not showing up and i don't how to get it back and i searched all over the internet i can't find an answer. I tired lot of methods to bring the design view back but it's just brings up the code like in the 2nd image. Please help!

You can open project in VS 2017 by two ways: open folder where files are located or open solution: .sln file:
Open solution give you some advantages, for example you can see compile, debug and as in this case see form design view.

#aace2030 I have face the same issue with VS 2017, but I was able to solve it. What you got to do is right click on your form, for example if your form name is "Form1.cs". Right click on it and you'll see an option called "Include in project", just click on it, this should solve your problem.

Related

Visual Studio MVC Scaffolding With T4 Templates Is Very Slow

I'm working on an ASP.NET MVC web application that consists of 43 projects in one solution. We've created some T4 templates for generating/scaffolding Controllers and Views and they're working as they should, but upon selecting Add -> Controller > MVC 5 Controller it hangs on Gathering Information loading screen for about 4-5 minutes until giving you the option to name your Controller and finally creating one.
The same thing happens when selecting Add -> View, but in this case the Gathering Information part is happening before a dialog in which you choose a view template even opens. After choosing any template it creates a new View almost instantly.
This is happening in both Visual Studio 2015 and 2019. I suspect it has something to do with a size of a solution, because in a blank project in a newly created solution it works just fine.
Does anyone know what might be the cause of this problem and is there a way to solve it?
I just ran across this issue in a solution with 7 projects. Ultimately I ended up unloading all of the projects except the one I wanted to add the controller to. After that, I was able to add the controller with just a few seconds delay, then reloaded the other projects.
For those who may not be familiar with multiple project solutions, to unload projects, in the Solution Explorer, select them by clicking the project while holding either the Ctrl or Shift buttons just as you would when selecting files in file explorer. Once selected, right click and select "Unload Project."

Solution Explorer opens in Folders view

Visual Studio 2017.
I have a project that have been working on for some months. Now all of a sudden whenever I open the solution, Solution Explorer will show it in Folders view. I have to click the following button and select the other option to show it in Solution view:
How do I restore it to the usual situation?
In My case,
I opened the folder where the actual files of the project are placed in file explorer.
And double click on the solution file(file with extention .sln).
It will be opened in the usual view(Solution View)
If you've copied a repo from github and created a solution, make sure you save once before switching to folder view. I forgot to save the newly created solution once, switched to folder view and as a result, could not get back to solution view. Very strange that my solution was somewhere in the void. I restarted VS 2017, recreated the solution and saved it.
By clicking on the same icon has worked for me though i found my whole solution got check out.So before clicking make a note which files are actually for checkout in TFs .
This was happening on one of my projects. I would change to Solution view, save/commit, but the next time I opened it, it was in Folder view again.
I don't know where the "last view" is stored, but apparently it's not in the .sln file.
I right-clicked on the solution and used Open in File Explorer, and opened the .sln file with VS Code and added a blank line at the bottom to "touch" the file. Then I reloaded and checked it in and it stuck.

Debugging from a View file

Working on a C# MVC project, I can have multiple files open in Visual Studio. When I press F5 to start debugging, the debugging starts if the currently open file is:
a controller (*.cs);
a model (*.cs);
a stylesheet (*.css);
a config file (*.config);
a partial view (*.cshtml)
However, if the open file is a View (*.cshtml), the browser opens with the "Server Error - URL not found" page.
Additional info: The solution has always been under source control with SVN but at some point, the repository location changed and from then on (I think), this strange error occurs. It didn't happen before, I could debug without thinking if a view file was open or not. The change wasn't performed by me and I lack details on it. I am not sure these things are related either.
Anyone has come across a similar issue? How to solve it?
I am guessing the problem is your project setup. Do following:
Project right click -> Properties -> Web -> Start action
Most likely it has "Current page" checked, which does not play well with ASP.NET MVC view, it just tries to open the view directly, and not via route. Every other type of file you mentioned is not detected as page, and thus VS does not try to open them as such.
You might want to choose a "Specific URL" there, or just make a habit of switching to a different file before hitting F5.

Issues editing ASP.net Razor view files while debugging

I am building an MVC3 application using RAZOR in VS 2010. TFS 2010 is being used for source control.
When debugging the application, it is helpful to be able to modify the Razor view files on they fly. If I open a checked-out view file in VS2010 before I start debugging, I can edit this file while I am debugging. If I open it after I start debugging, it cannot be edited whether it is checked out or not.
Interestingly enough, if I open a read-only file after I start debugging and begin to type in the view to edit it, the file is checked out from source control, but cannot be modified. Additionally, when I stop debugging, I must close the file and reopen it in VS in order to edit it.
Just to clarify, if after I start debugging, I open a view file I already had checked out (not read-only), I cannot edit this file. When I stop debugging, I have to close and re-open the file to be able to edit it.
I have edit and continue turned on, and it works as expected for the controllers and models.
It feels like there is a setting that I am missing somewhere.
Thank you for your assistance.
I've suffering this bug for more than a year. See my question about the problem here: Edit a view in Runtime
This hotfix solve the problem for me.
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=40811

Workflow Foundation: Designer is not working

When I try to open any activity in design mode designer fails with message "The document contains errors that must be fixed before the designer can be loaded. Reload the designer after you have fixed the errors". The project builds and runs fine though. This happens even with a fresh newly created solution. I mean that if I create a new workflow project and add a new item -> activity the problem persists.
If I click "Reload the designer" I get the following error: "Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'System' that is not included in the assembly". If I build the project the error disappears but the designer doesn't start working.
I'm using VS2010 Premium. The only plugin installed is ReSharper. However I tried removing it but it didn't solve the problem. I've also asked a friend of mine to reproduce the same error on his computer but everything worked well.
The problem was that there are several types of editor for .xaml files. If you right click open with you can choose one of them. In my case WPF designer was selected by default though it's better to choose automatic selection.
Hope this information will be helpful for someone else :)

Resources