CodeConverter icon indicating copy to clipboard operation
CodeConverter copied to clipboard

VB -> C#: cannot specify /main if building a module or library.

Open ATECoder opened this issue 4 years ago • 3 comments

Input code

    <StartupObject>isr.Dsp.%28None%29</StartupObject>

Erroneous output

    <StartupObject>isr.Dsp.%28None%29</StartupObject>

Expected output

    <StartupObject></StartupObject>

Details

  • Product in use: codeconverter.icsharpcode.net / VS extension
  • Version in use: artifact 8.1.8.0 of 10/12?
  • Did you see it working in a previous version, which? N/A

Some VB.Net library projects include a non-empty 'StartupObject' section in the project file. Because the converted C# code keeps this section, the code, which compiles under VB, does not compile under C#.

  • Any other relevant information to the issue, or your interest in contributing a fix.

ATECoder avatar Oct 28 '20 15:10 ATECoder

I think in many situations, just removing it is sufficient, though there is a valid use for this in C#, the "object" it's describing just slightly differs I think

GrahamTheCoder avatar Oct 28 '20 17:10 GrahamTheCoder

Just to make sure: the ‘cannot specify…” message in the title of this issue came from VS. I presume telling us that C# is unhappy about this section. These messages are often quite obtuse being comprehensive/clear possibly at the time the developer wrote them 😊

That said, could there be a startup object for a library? Maybe.

From: GrahamTheCodermailto:[email protected] Sent: Wednesday, October 28, 2020 10:36 AM To: icsharpcode/CodeConvertermailto:[email protected] Cc: David Harymailto:[email protected]; Authormailto:[email protected] Subject: Re: [icsharpcode/CodeConverter] VB -> C#: cannot specify /main if building a module or library. (#672)

I think in many situations, just removing it is sufficient, though there is a valid use for this in C#, the "object" it's describing just slightly differs I think

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ficsharpcode%2FCodeConverter%2Fissues%2F672%23issuecomment-718095712&data=04%7C01%7C%7C2bc4b73ef3c649085c6208d87b67fc49%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637395033824478697%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9Cx7y20g1rB3OcHix3Xb5UGF6bIbqN9z1wpuk6heBQk%3D&reserved=0, or unsubscribehttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAGBGSUFSUNNZWQ5Z7NEJWTSNBJBLANCNFSM4TCPUYYQ&data=04%7C01%7C%7C2bc4b73ef3c649085c6208d87b67fc49%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637395033824488692%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wiZtsj5l2IHSt6Ecy1dRe%2BtbtGLc6KGJOSG1pvJ7PMM%3D&reserved=0.

ATECoder avatar Oct 28 '20 17:10 ATECoder

Ah sorry I didn't really take on board that you meant only for libraries. There's a separate issue with winforms startup objects I was thinking of. Libraries should just remove it I think yes.

GrahamTheCoder avatar Oct 28 '20 18:10 GrahamTheCoder