Share via


MVC 5 problem - I can't add new controller

Question

Monday, November 2, 2015 2:37 PM

Hello, hello, hello!
Many people write about it. Some overcame this problem others are still struggling. Check is very strange. I create new applications MVC in Visual Studio Pro 2013 installed all the updates, the program can compile and run. I can not add folders to specific new elements, eg. A new Controllers.
The option is disabled. Nothing helps, already twice reinstalling Visual Studio, I read all the entries in the forums. I struggled with the changes <ProjectTypeGuids>
Nothing helps. What to do? At the colleague beside everything works as it should.
The properties have: System.Web.Mvc Version 5.0.0.0
Runtime Version v4.0.30319 I added and removed the references.
Please from about a good indication.
Regards
Piotr

All replies (13)

Monday, November 2, 2015 3:12 PM

Hi,

Could you please provide a screenshot of were you are getting Controller option disabled?

Thanks,

Sabah Shariq


Tuesday, November 3, 2015 9:01 AM

Thanks for Sabah Shariq's reply.

Hi Piotr,

Do you mean the add option in right-click context menu disabled as below image?  What do you mean "can not add folders to specific new elements"? Does it should be add new element to specific folders?

Please create a other type of project to make sure this problem is occurred with ASP.NET MVC 5 project or with all project type.

Please try with following steps to troubleshoot this problem.

  1. Run Visual Studio as Administrator.
  2. Open Visual Studio in safe mode with "Deven.exe /SafeMode" command to prevents all third-party VSPackages from loading when Visual Studio starts, thus ensuring stable execution.
  3. Please confirm you have checked "Microsoft Web Developer Tools" in the Modify window through Control Panel -> Visual Studio 2013 -> Change -> Modify.
  4. Please use http://aka.ms/vscollect  to gather the VS and .Net Frameowrk installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file to Onedrive and share the link here.

Best Regards,
Weiwei


Tuesday, November 3, 2015 11:07 AM

Hello! Thank you!

I made big file vscollect: is public on http://gst-global.pl/vslogs.zip

I am goin to add some pictures but I am waiting to be verified by forum administrator.

I hove some information in vslogs help us to solve this strange problem.

Have a nice day!

Piotr


Tuesday, November 3, 2015 12:36 PM

Thank you!

I prepared some screen - please open web page:

http://www.fileconvoy.com/dfl.php?id=g7dc67ee60bf057f5999743467461a2f4b8c3e5744

MVC4 - shows that version 4 is ok - MVC5 has problem

NoControllers.png - problem with new Controller

ReferenceProperties.png - I have new mvc library

Have a nice day!


Monday, November 9, 2015 7:16 AM

Hi Piotr,

The link of vscollect can't be open, so I can't get the installation files.

According to the screenshot that you provided, please check the ASP.NET project's Target Framework whether it is 4.5.1.

Besides, please check the folder in your MVC 5 project, whether they are read-only. Please open find the folders in solution folder, right-click to open its Properties window to check its read-only property.

In addition, please try with following steps to restore the add Controller menu.

1. remove the reference to the System.Web.Mvc in your project.

2. open a new instance of vs 2013 and create a new mvc project (please use an empty template and check the MVC checkbox)

3. find the referenced file for System.Web.Mvc in the new mvc project.

...\WebApplication1\packages\Microsoft.AspNet.Mvc.5.2.0\lib\net45\System.Web.Mvc.dll

4. return to the original project, and add reference by browsing the file from above step.

5. rebuild the project, and then try to add Controller.

Please confirm you have install the latest Update for Visual Studio 2013. The latest version of Update is Update 5. Please get it from below link.

https://www.microsoft.com/en-us/download/details.aspx?id=48129

Best Regards,
Weiwei


Monday, November 9, 2015 12:00 PM

Weiwei!

Unfortunately I did it all without success.
But I noticed something strange MVC5 we talking about me in the system VS2013 is still version 4.0.0.0
Maybe something wrong with this file?
Please further guidance


Tuesday, November 10, 2015 1:27 AM

Hi Piotr,

I think the problem is caused by the version 4.0.0.0 of System.Web.Mvc in your MVC 5 project. Please make sure you are creating MVC project in Visual Studio 2013 under Templates -> C#(any other Language) -> Web with .NET Framework 4.5.1 as below image. Not Templates -> C#(any other Language) -> Web -> Visual Studio 2012.

If you have do with above steps, please check whether you have installed Microsoft Web Developer Tools. Please open Visual Studio 2013 in Control Panel and right-click it to change it. It will show a change window with a Modify button. Click Modify to check the feature have installed. If not checked, please check it and update it.

In addition, please provide another link where your installation log uploaded, the previous link you provided can't be opened.

Best Regards,
Weiwei


Tuesday, November 10, 2015 11:06 AM

Dear Weiwei,

I generated for you new file - 180MB

http://www.gst-global.pl/vslogs.zip

Please open it - I belive you can help me.

Thank you

Piotr


Wednesday, November 11, 2015 2:07 AM

Hi Piotr,

There are several error in your installation logs. This may be the reason causes this problem. But we can install MVC 5 individually through NuGet Manager.

Please click Project menu in Visual Studio and choose "Manage NuGet Packages...". Then searching "mvc" in Manage NuGet Packages window. The "Microsoft ASP.NET MVC" will list as the first one. Its version is 5.2.3. Please install it.

Best Regards,
Weiwei


Thursday, November 12, 2015 7:55 AM

Dear Weiwei!

I did it before, install + uninstall = no succes

This problem is more complicated. Is it possible to solve it?


Thursday, November 12, 2015 8:53 AM

Hi Piotr,

I found the installation exit code is not 0x0, which means your Visual Studio is not installed corrected.

Please make sure whether the package is well, Please use FCIV.exe to verify hash of the ISO. Any discrepancy would indicate that the file was corrupted. Here is a blog for how to use it, you can refer to it.

After you get the SHA-1 Value, please compare the value of your Visual Studio version with following link listed.

https://www.visualstudio.com/en-us/downloads/visual-studio-2013-iso-sha1-vs.aspx

If the installation package is broken, please download the ISO package from below link.

https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx

If the installation package is correct, please change another computer to install it, which can help us make sure whether this problem is related to your computer environment.

Best Regards,
Weiwei


Friday, November 13, 2015 1:27 PM

Thank you for your help.

I made uninstall and install again from microsoft network. I cleared directory for VS2013, restarded when I was asked. I think that some keys in registry has invalid value. I can't fix it.

Installation ok - no any error message

I created new file vscollect: is public on http://gst-global.pl/vslogs.zip - now it has 250MB

I hope that we finally succesfully run this Visual Studio 2013.

Thank you!

Piotr


Monday, November 16, 2015 8:55 AM

Hi Piotr,

The new file vscollect link can't be opened.

>> I think that some keys in registry has invalid value. I can't fix it.

You can try delete all registry which related to Visual Studio before you re-install Visual Studio.

In addition, I suggest you change another computer if your installation package is correct. There may be something wrong on your current computer. We need to exclude the possible from current computer environment.

Best Regards,
Weiwei