CodeConverter icon indicating copy to clipboard operation
CodeConverter copied to clipboard

Convert to C# does not appear on context menu

Open BillClarkEarthPoint opened this issue 1 year ago • 2 comments

Steps to reproduce

  1. Right click any vb file in Solution Explorer
  2. "Convert to C#" does not appear on the context menu. The last item on the menu is "Rename"
    • OR -
  3. Drag the mouse to select any code within a vb file.
  4. Right click on the selected code.
  5. "Convert to C#" does not appear on the context menu. The last item on the menu is "Outlining"
    • NOTE -
  6. Visual Studio was closed for installation.
  7. Computer has since been rebooted, but the problem remains.

Error message shown

  • Follow the steps on the wiki - where do things go wrong?
  • Copy and paste any error messages / relevant text and/or screenshot the incorrect behaviour.

None. "Convert to C#" is not listed on context menus, so process is never started.

If there's no error message, try the Visual Studio Activity log:

Run Visual Studio with the /Log command line switch to write ActivityLog.xml to disk during your session. After closing Visual Studio, find the activity log in the subfolder for Visual Studio data: %AppData%\Microsoft\VisualStudio<version>\ActivityLog.xml.

Not applicable.

Details

  • Product in use: e.g. icsharpcode.github.io/CodeConverter / VS extension / both
  • Version in use: e.g. 5.6.3 or a commit hash (if it's a 3rd party tool using this library, try one of the above)
  • Did you see it working in a previous version, which?
  • Any other relevant information to the issue, or your interest in contributing a fix.

This is my first time trying CodeConverter

According to the Visual Studio "Extension Manager" version 9.2.6.0 is installed.

According to Visual Studio "Help" Visual Studio Version is

Microsoft Visual Studio Professional 2022 Version 17.11.5 VisualStudio.17.Release/17.11.5+35327.3 Microsoft .NET Framework Version 4.8.09032

Installed Version: Professional

BillClarkEarthPoint avatar Oct 23 '24 18:10 BillClarkEarthPoint

The main thing that jumps to mind is that you might be using a "website" project, which doesn't have a vbproj file and hence can't trigger the extension. If that's the case, just create a vbproj that contains all the relevant files (that compiles) and use that during the conversion

GrahamTheCoder avatar Oct 27 '24 17:10 GrahamTheCoder

Hello Graham,

Yes, this is a website project.

I created a vbproj file using another project file as a template. I listed all of the website vb files, restarted Visual Studio, but there is still no “convert” on the context menus.

To illustrate, here is a copy of the vbproj file with just one vb file listed.

Best regards,

Bill Clark www.earthpoint.ushttp://www.earthpoint.us/ (208) 860-6311

From: Graham @.> Sent: Sunday, October 27, 2024 11:19 To: icsharpcode/CodeConverter @.> Cc: Bill Clark @.>; Author @.> Subject: Re: [icsharpcode/CodeConverter] Convert to C# does not appear on context menu (Issue #1143)

The main thing that jumps to mind is that you might be using a "website" project, which doesn't have a vbproj file and hence can't trigger the extension. If that's the case, just create a vbproj that contains all the relevant files (that compiles) and use that during the conversion

— Reply to this email directly, view it on GitHubhttps://github.com/icsharpcode/CodeConverter/issues/1143#issuecomment-2440105727, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACVNP2GJKI7QQ6O3NRDD2RDZ5UHANAVCNFSM6AAAAABQPPEIUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQGEYDKNZSG4. You are receiving this because you authored the thread.Message ID: @.@.>>

BillClarkEarthPoint avatar Oct 28 '24 19:10 BillClarkEarthPoint