How does visual studio link files to their corresponding designer.cs files? I have a strange situation that's occurred with both the DataSet designer and also the L2S DBML designer where it's ignoring the DataSet.Designer.cs and has created and used a DataSet.Designer1.cs instead. How can I switch it back?
+1
A:
Information about related files is written in project files (*.csproj). This may fix problem:
- exclude DataSet designer from project
- close Visual studio
- remove Designer1.cs from disk
- remove Designer.cs from disk (if it exists)
- start Visual studio
- open DataSet designer
- now you should have Designer.cs
Alternative would be to try to change information in *.csproj file and then to rename Designer1 to Designer in all places it occurs. I did not try this, but it may work.
zendar
2010-03-31 09:28:23
+1 you are a gentleman and a scholar, I thank you. :) I actually did the renaming thing you suggested and it worked a treat. Marvellous.
Neil Barnwell
2010-03-31 09:39:17
A:
Thanks to Zendar's suggestion, this is what I did:
- Close Visual Studio.
- Use TortoiseSVN to rename the
DataContext1.designer.cs
file toDataContext.designer.cs
, so the rename is picked up by source control. - Opened
MyProject.csproj
in Textpad. - Performed search and replace for
DataContext1.designer
withDataContext.designer
(found 2 instances). - Save and close.
Re-opening and building the solution in Visual Studio confirmed this worked. Thanks Zendar!
Neil Barnwell
2010-03-31 09:42:43