Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015 error was encountered during code generation, changes not committed to source

First off, I wish I had more information to give you but I am kinda puzzled with this error from Microsoft Visual Studio 2015:

An error was encountered during code generation. The changes you have made in the designer have not been committed to the source code. It is recommended that you close and re-open the source file. The error message follows: Value does not fall within expected range.

A bit of additional information I hope will be useful... This has been my first time encountering this nagging and persistent error. Right after my day job, I sat right down on my computer and started working happily away on my lil programming project. Everything was good, VS2015 Community started up like usual, but AS SOON AS I PLACED ONE BUTTON (literally, one button... dragged and dropped... didn't change anything else...) from my toolbox onto my winform, this agitating error pops up screaming nonsense. I worked for hours on my little project yesterday, debugged and tested everything before I went to bed and it all worked perfectly fine. I was happy.

I did some online research, and tried everything from repairs/reinstall to VS2015 as well as other things, like making sure all my columns in my SQLSERVER Express DB are set Visible = True. They were. I tried closing and reopening my project, VS 2015 and even restarting my desktop. This awful error is persistently following me for dragging and dropping a button on my winform, and I hope I don't lose my project. The backup save I tried to load is doing the same thing as well. I also read this was supposed to be an issue fixed with SP1 for VS? Just in case, I made double sure I'm currently up to date with fixes and downloads from Microsoft for VS.

Has anyone run into this error?! If so, please advise on how to fix and save my behavioral statistics calculator!! Thanks Overflowers!

like image 900
shrug Avatar asked Apr 28 '16 21:04

shrug


2 Answers

It is a problem in VS and Microsoft provided a hotfix for the issue.

like image 110
Ahmed Fathy Avatar answered Oct 14 '22 14:10

Ahmed Fathy


I got this message after creating a TableLayoutPanel and moving some controls into it. At that point, I couldn't save the source file, the Designer file, our either from the [Design] view.

I was able to undo the last changes by selecting everything in the Designer.vb file, cutting it to the clipboard, and saving. No error message. Then I pasted everything back, saved again, and there was no error message. I checked the [Design] and the TableLayoutPanel was gone, but my controls were where they were prior to adding them to it.

After that I repeated the same steps to add the TableLayoutPanel and put the controls in it and I got no error message. It was relatively inexpensive in terms of wasted time to deal with this message. I'm not sure what would have happened if I had closed the solution according to the messages suggestion but I didn't need to find out.

like image 40
djv Avatar answered Oct 14 '22 15:10

djv