Naveen's Weblog

Bridge to future

The designer cannot process the code at line

Posted by codingsense on December 5, 2010


From somedays back I was getting a weird problem while opening the design of windows form. The error message looked like the below one

The designer cannot process the code at line 37: this.comboBox1.Items.AddRange(new []{ “one”, “two”, “three”, “four”}); The code within the method ‘InitializeComponent’ is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.

If I commented the AddRange line it was working fine or It was pointing at the next line those had AddRange method. I quickly googled for the solution and found many but none of the fix was useful. By careful observation I found that something was missing the line. See if you can observe what’s missing the below line 😉

 this.comboBox1.Items.AddRange(new []{
“one”,
“two”,
“three”,
“four”});

Just adding the type of the array that I was creating solved my problem, for above problem I added new object[] and then all worked fine.

this.comboBox1.Items.AddRange(new object[]{
“one”,
“two”,
“three”,
“four”});

After fixing the issue I started searching for the person who had removed it, I wanted to show him the issue so that he will not do the same next time. After searching for hours I found that it was Mr. ReSharper who had removed the type. From then I started carefully using Resharper instead of just clicking on what it suggests.

Happy coding 🙂
Codingsense

Advertisements

2 Responses to “The designer cannot process the code at line”

  1. Anandkumar said

    Hi Naveen,

    I am not using ReSharper then also some time i am getting this error. Is there any other third party tool is effecting it?

    Anandkumar

    • codingsense said

      Hi Anand,

      Are you getting the same error that I have mentioned?
      Check the error, is it taking you to the AddRange line when clicked on show code?? What other tools are installed as plugin for your Visual studio??

      Thanks,
      Naveen Prabhu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: