Reputation:
Came across this curiosity recently.
One solution, with two projects within it (ORM and website). Visual Studio 2010 Ultimate on both computers, setup identically.
Solution and projects created on computer A, all .aspx pages have .designer.cs files.
Solution and projects copied to computer B and new web pages added, all new .aspx pages do not have .designer.cs files although the website still works fine.
Move new content back to computer A, and it now errors on rebuild with errors relating to the missing .designer.cs files.
Why would this happen? Why would two VS2010 installs handle this differently with the same solution and project files?
Upvotes: 9
Views: 4958
Reputation: 5914
Right click on .aspx, choose "Convert to Web Application".
Reason: because your 'home' computer is certainly different from work computer, it can be many things. Corrupted VS template, some VS addin, .net framework, anything.
Problem with generating designer.cs is occuring since VS 2003, so answer to your 'why' question lies within VS internals.
Upvotes: 3
Reputation: 15673
Kind of a shot in the dark, but based on the file transfer method--does VS create the .designer.cs files as hidden? And do they get missed in the transfer.
That said, have you considered version control? It is the first thing any software project needs IMHO.
Upvotes: 1
Reputation: 6278
I had this problem so I removed the generated.cs files from version control and made a prebuild task for that project.
Check MSBuild, custom task to run custom tool to generate classes for linq to sql model? for more info
Upvotes: 1
Reputation: 738
Sounds like it could be related to the Web Site\Web Application project types in VS2008 and higher. Are you opening the same project\solution file on each machine?
Upvotes: 1