Reputation: 109
I have a problem with Visual Studio 2012. I have this message "The designer could not be shown for this file because none of the classes within it can be designed" after the next actions: file - create - project - Application Windows Forms. I do not do nothing else. I have already tried to repair VS, but it couldn't help. Please, tell me what should I do to solve this problem. There is a code below:
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace WindowsFormsApplication9
{
static class Program
{
/// <summary>
/// Главная точка входа для приложения.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Form1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication9
{
public partial class Form1: Form
{
public Form1()
{
InitializeComponent();
}
}
}
Upvotes: 1
Views: 366
Reputation: 147901
It seems like your Visual Studio installation is corrupt. The first answer to this question may solve your issue.
The solution is, briefly:
HKLM\SOFTWARE\Classes\Installer\Assemblies\Global\
. Note the Interop
part because there is also Microsoft.VisualStudio.CSharp.Services.Language
assembly, which must be in the GAC.VS2012 x86 Native Tools Command Prompt
and run gacutil /u Microsoft.VisualStudio.CSharp.Services.Language.Interop
Upvotes: 1
Reputation: 10452
Right click on project and go to Properties
, make sure target framework is set to .NET 4.0
and not .NET 4.0 Client Profile
or any other framework.
Upvotes: 0