Unusual Designer1.cs files created

How do visual studios link files to the corresponding designer.cs files? I have a strange situation that arose with both the DataSet designer and the L2S DBML designer, where he ignored DataSet.Designer.cs and instead created and used DataSet.Designer1.cs. How can I get it back?

+7
visual-studio-2008 designer
source share
2 answers

Thanks to Tsender's suggestion, this is what I did:

  • Close Visual Studio.
  • Use TortoiseSVN to rename the DataContext1.designer.cs file to DataContext.designer.cs , so renaming is done using the source control.
  • Opened MyProject.csproj in the text pane.
  • Performed search and replacement for DataContext1.designer using DataContext.designer (2 instances found).
  • Save and close.

Reopening and building the solution in Visual Studio confirmed that it worked. Thanks Zendar!

+10
source share

Information about linked files is written to project files (* .csproj). This may fix the problem:

  • exclude the DataSet constructor from the project
  • close visual studio
  • remove Designer1.cs from the disk
  • remove Designer.cs from disk (if one exists)
  • start visual studio
  • open DataSet constructor
  • you should now have Designer.cs

An alternative would be to try to change the information in the * .csproj file, and then rename Designer1 to Designer to all the places where this happens. I have not tried this, but it can work.

+8
source share

All Articles