简体   繁体   中英

Converted c# proj(from vb) doesnt allow to add files

I have ac# project converted from VB.

When I say converted, I did not create a new project from scratch but I took the VB project changed all the file names, code and the proj file.

Project builds and works fine but when I try to add a new item it shows all the VB items in the list and not C#. Sorry I couldn't post the image (it requires at least 10 posts)

Any thoughts?

your 'Create new project should look something like (this is for 2012): 在此处输入图片说明

      ^ ^ ^
      | | |
      | | |
       Here

Down the left hand side, you should see 'Visual C#'.

Selecting 'Visual Basic' will create a vb project, but you want to create a C# project.

EDIT

Following these steps would allow you to install further templates:

To install project templates from the New Project dialog box

On the File menu, click New, and then click Project. The New Project dialog box opens.

In the left pane, click Online Templates and expand the Templates list.

In the Templates list, select the category of templates to search for

-- OR --

Type one or more keywords in the Search box.

A list of templates appears in the middle pane.

More information can be found here

EDIT 2

To Help others coming across this question in the future;

The OP used Sharp Develop to convert from C# -> VB -> C#

The OP noted that the (main) difference in both the project files that they found was the initial C# project had below line immediately below the tag:

Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props' 

If this approach may help others: I converted my converted C# project to VB using SharpDevelop and then converted it back to C#. The difference in both the project files that I found is the initial C# project had below line immediately below the tag: Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props'

Below is from jbutler

As said in the comments, if they are 'converted' already, once you're in a new c# project it'll be a matter of 'Add->Existing item' and choosing the 'converted' classes –

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM