views:

608

answers:

3

Hi, I have a problem in my project with the .designer which as everyone know is autogenerated and I ahvent changed at all. One day I was working fine, I did a back up and next day boom! the project suddenly stops working and sends a message that the designer cant procees a code line... and due to this I get more errores (2 in my case), I even had a back up from the day it was working and is useless too, I get the same error, I tryed in my laptop and the same problem comes. How can I delete the "FitTrack"? The incredible part is that while I was trying on the laptop the errors on the desktop were gone in front of my eyes, one and one second later the other one (but still have the warning from the designer and cant see the form), I closed and open it again and again I have the errors...

The error is:

Warning 1 The designer cannot process the code at line 27:

Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11

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. C:\Documents and Settings\Alan Cardero\Desktop\Reportes Liquidacion\Reportes Liquidacion\Reportes Liquidacion\Form1.Designer.vb 28 0

+1  A: 

I would take out the static assignment in the designer to the resource CrystalReport11 and then add a load handler to your form and before setting the ReportSource back to CrystalReport11 do a check

If(Not DesignMode) Then Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11

Here is a mockup..

Public Sub New()
 InitializeComponent()

 AddHandler Me.Load, New EventHandler(AddressOf Form1_Load)
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
 If (Not DesignMode) Then Me.CrystalReportViewer1.ReportSource = Me.CrystalReport11
End Sub
Quintin Robinson
+1  A: 

I would back up the designer.cs file associated with it (like copy it to the desktop), then edit the designer.cs file and remove the offending lines (keeping track of what they do) and then I'd try to redo those lines via the design mode of that form.

Kearns
A: 

You should be able to take a backup, clear the lines that are having problems then when you re-open it the designer will fix the code.

The key is that you want to let the designer re-generate, then just validate that all needed lines are there.

That usually works for me, but you just have to be sure to remove all lines that it doesn't like.

Mitchel Sellers