Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7490583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:40:51+00:00 2026-05-29T15:40:51+00:00

I am converting a large VB.Net project to C#. I used an free automated

  • 0

I am converting a large VB.Net project to C#. I used an free automated tool to convert them. VB is happy with empty parameters passed in and uses default values for them supplied in the method definition.
After the conversion, there are many calls in the C# code looking like this:

GetElement(ndFirst, WAIT_AFTER_BATCH,false, , , "WAIT");

And compiler is not happy…

Can someone point me in the right direction if I can edit the C# files automatically(since intellisense knows how to) to fill these default values when I am making the call.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:40:52+00:00Added an answer on May 29, 2026 at 3:40 pm

    I am assuming that the C# version of your methods has the default parameters specified correctly, ex.

    public void SomeMethod(int paramA = 0, int paramB = 1, int paramC = 2){
       ...
    }
    

    If you want to call the method and accept the default for paramB (as in your example), then you need to name the parameters

    SomeMethod(paramA: 12, paramC: 20);
    

    This would collect values for paramA and paramC whilst using the default for paramB.

    Furthermore, since paramA is in the correct position, this will also be correct

    SomeMethod(12, paramC: 20);
    

    Alternatively, if the parameter you want to leave out is the last one, you can simply leave it out and call your method like so

    SomeMethod(12,20);
    

    Where paramA = 12, paramB = 20 and paramC will use the default of 2.

    Unfortunately I am unaware of an automatic way to fix these. Likewise, to speed you up, you can use ReSharper and create a formatter to enforce using named arguments. Then run a simple regex over your project and clean out any instances of ‘,,’

    Note I am in no way affiliated with JetBrains or ReSharper. I am a mere client of this company.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm converting a fairly large project from using .NET 3.5 to .NET 4 using
I'm converting a large, multi-project CVS repository into Subversion using cvs2svn. It's working really
I'm working on a project that involves converting a large amount of HTML content
When converting a project (in which a template method of IComparable was used a
We have a large ASP.NET project which has 100s of BLL classes. In our
If you are given a large n-tier project (.NET) with 15,000 lines of code
I've got several large MFC applications here, and converting them into any other format
Can anybody suggest a tool or share code which can help me converting large
I'm working on a rather large Asp.net MVC3 project and would like to use
I am converting a large solution from Visual Studio 2008 to Visual Studio 2010.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.