VS2013 new MVC 5 project missing Add Controller option in context menu - visual-studio-2013

When I create a new MVC 5 project in a new solution in VS2013 Professional, the context menu of the Controller folder does not have the option to add a controller. Also in the context menu of the View folder, the option to add a view is missing.
I’ve created the MVC 5 project in the following way:
Select “New Project” in the Start Page
Select “ASP.NET Web Application” in the “New Project” window
Select “MVC” in the “New ASP.NET Project” window
In other words exactly like explained in http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started but the Add Controller and Add View options are not shown afterwards.
What I’ve already done:
Uninstall and reinstall “VS2013 with update 3” completely (including all components that remain installed after uninstalling VS2013)
Added {E3E379DF-F4C6-4180-9B81-6769533ABE47} as 'the first GUID' in the project .vbproj as suggested in some topics about this problem (e.g visual studio 2013 'add controller' missing) but VS2013 undo the change when I open the project again in VS2013.
I looked already to several topics about this problem but could not found a solution for my case.
Please help me.

Recently I also faced the same issue and I am assuming that it has to do something with Visual Studio 2015 CTP6.
Uninstalling and Re installing AspNetWebFrameworksTools_VS12_ENU.msi did the trick for me.
You will find this file in "DVD Drive:\packages\WPT" folder.
I hope this helps others and save their time.

For those who are still struggling with this problem, the problem is solved by “accident” in my environment.
Because of a company rule, we had to add our computers to a domain and got a domain account we use to login in the domain. After using that account for a while, I thought: Is this “missing Add Controller option” problem still there? Miraculously the problem is gone as long as a use the domain account!
To locate the origin of the problem, I did some tests with existing and new solutions and came to following conclusions:
When I login with the original local account and open one of the solutions that are made when logged in with the local account, then the “Add Controller option” is still missing.
When I login with the domain account and open one of the solutions that are made when logged in with the local account, then the “Add Controller option” is there.
When I login with the domain account and create a new solution, then the “Add Controller option” is there.
When I login with the original local account and open the new solution that is made when logged in with the domain account, then the “Add Controller option” is there.
FYI: The same applies for the “Add View option”.
In other words, for those who are desperate try to create a new (local ?) user account. Maybe it solves the problem also in your case.
Good luck!
Dirk.

Related

I can't remove the name of Team Foundation Server URL in Visual Studio 2017

I added a user to Team Foundation Server DevOps, but when the user entered the URL made a mistake, he entered an URL that does not exist.
I tried to remove this broken address, but does not let me delete it, there is no way to delete it in the graphical interface of Visual Studio, I tried to correct eliminating the cache of Team Foundation, I have tried to remove the workspaces, but it does not manage to eliminate this broken URL.
I have also tried to modify this URL that is misspelled but when editing the workspace, will not let me modify that address.
Here is a screenshot of the URL I want to delete, when I delete a workspace and click on Update or simply add the server to which the new user has permission to access for some reason the broken URL is not deleted, it seems that when you click on the download button and assign the existing server files if it appears as if you downloaded the solution's files but when checking in the file explorer there is nothing, and the broken URL is still there by default, I send a screenshot so you can view the problem, you will not find the local path where the files are saved because the entire Team Foundation Server cache is reset.
The broken URL
Ok, I found the solution, it turns out it was very simple, the problem was that when you add the user to the project by default is added to the stakeholder level, and that level does not allow changes in the source code, only at the administrative level, such as assigning Tasks, view assigned tasks, etc...
At the time of wanting to change the level within the project in the Web portal does not allow it to do because the change must be made at the organization level, so it is only necessary to enter the portal of the Organization then:
Click on Organization Settings--> Users--> Change access level (click on 3 dots in name of user) --> Change from Stakeholder to Basic
Ready... Problem fixed!
I'll add some screenshots of the process:
Click Organization Settings
Click on Users
Change access level
Change Stakeholder to Basic

TFS lets me do compare and checkout, but not checkin

I have been using TFS in my visual studio 2013 for some time now but now I have a problem.
When it was initially setup I logged into TFS from VS using the domain\Administrator.
But company policy has changed and now the password is changed and I dont know it anymore.
But my own domain user has been granted administrator rights so I think ok no problem next time I start VS and TFS asks me to login I provide my own account.
This did not work I got tons of errors so I had to go to Control Panel and remove this credential from credential manager.
So I started VS again and let someone type in the pass for Administrator again, and click on remember.
That seemed to work, I can do a compare of files and it is correct.
I am also able to checkout files for editing.
But when I want to check in than it displays an error for a split second and it shuts down my project in VS.
After numerous tries I was able to capture a screenshot of the error (it only displayed for a split second).
This is the error :
I have no clue what this thing is talking about and I am hoping someone here can push me into the right way to find a solution for this.
Where can I find this workspace and how can I give it permissions ?
I am using visual studio 13 on local computer, logged in to domain and my user account has administrator rights.
EDIT:
I found a screen in VS to edit the workspace. The permissions are currently on Private Workspace.
So set it to public and now I also cannot do Compare and Checkout anymore.
Setting it back to private does not helps I keep getting this error now.
Any suggestions ?
Edit:
There seem to be 2 workspaces with the same name but I can only see on in manage workspaces. Maybe if I can get rid of one somehow.
In this screen I can see 2 workspaces :
How can I get rid of the second ?
EDIT:
IT seems that VS keeps searching for the wrong workspace.
See this screenshot :
I configured a new workspace PC_GUIDO_2 but if I do a compare it keeps searching for workspace PC_GUIDO even if the workspace combobox says PC_GUIDO_2.
How can I force it to stop searching for that workspace ?
Please try following below steps to fix the issue:
Make sure your account has the check in permission for the project.
(Administer Server > Version Control > Set the permissions)
Close VS
Delete the VS client caches
Start VS as administrator (Right click and run as administrator) and DO NOT LOGIN WITH VISUAL STUDIO
In team explorer connect TFS with your account
Manage Workspace to delete current workspace "PC_GUIDO"
Create a new workspace and map sources to new local folder
Then check the issue again.

Visual Studio 2015 - New Project Windows Obscuring Details

Hi I have Visual Studio 2015 - And when I try to create a new Windows Form Application - both the Location, SolutionName, CreateDirectoryforSolution box and Add to Source Control are missing - Yet if I select a "Telerik" type or other types it shows - I've checked on my colleagues machine and his works as predicted. ie Shows the other project elements.
Two images below - Any clues? Resizing the frame does not help.
Thanks
and with the correct details:-
Visual Studio allows you to create new projects without having to save them (temporary projects).
If you create a new Forms application, it will generate all the files etc. If you wish to save, click the Save menu option and the following window is shown:
You can control this behaviour via the options:
On the Tools menu, click Options.
Expand the Projects and Solutions node, and select the General node.
Make sure Save new projects when created is cleared, if you want to allow temporary projects; otherwise, make sure it's checked to be prompted for location and solution name when creating a new project.
Click OK.
With the Save new projects option is checked, you'll be prompted for a Name, Location and Solution Name when selecting the project type, as per the screenshot below.
This MSDN article: Temporary Projects provides a fuller explanation on the subject.

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 :)

generation of designer file failed

Every few days VS2008 decides to get mad at me and fails to generate a designer file claiming it cannot find the file specified and that it's missing an assembly. Here's the scenario:
The aspx page has a reference to a custom user control (inheriting UserControl) which references another assembly in the backend. There are many other references to this "missing" assembly in other places in code which don't throw errors. rebuilding, updating the source to the clean copy, shouting at the computer, punching the screen, etc all fail to work.
Any suggestions? This is quite annoying.
We've had similar problems before, unfortunately I don't remember the exact solution.
If your using a "Web Site" project (no project file) then start by checking that both your page and your control both set the ClassName property in the first line of your aspx/ascx file and that you specify the full name of the class including the namespace.
Example:
<#Control Language="VB" AutoEventWireup="false"
ClassName="YourProjectName.YourUserControl"
Inherits="YourProjectName.YourUserControl"
CodeFile="YourUserControl.ascx.vb"
%>
Many times not setting all of these will still work but you will get odd compiler errors and behavior in VS.
If you using a Web Site Application project try deleting the designer file manually and then right click on your project and choose "Convert from Web Application." This will should recreate the designer file for you.
My only other suggestion would be to recreate the page and/or the user control from scratch.
Jared, you've hit it. Using "Convert to Web Application" to manually generate the designer file solves my problem. I'm glad you posted this before i started reinstalling. Thanks.
You might try archiving a template of a new file with its designer equivalent. If VS coughs then you can do an "Add Existing" option with the file you already have.
It seems, however, to be an issue with your installation of VS2008 so you might try reinstalling it.
I found that using a custom control, you would need to add a reference to the .dll. This fixed it for me after migrating from a web site to web app.

Resources