9

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?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • 1
    Both are running the release version of VS2010 and neither are running a beta version? – fletcher Aug 23 '10 at 13:37
  • Both are running release, both have had the same beta version installed prior, both had the beta version removed and the release version installed in its stead. –  Aug 23 '10 at 13:47
  • Any Possiblity of virus? – Prince Ashitaka Sep 03 '10 at 16:50
  • I called tech support. They said reboot. If that doesn't work, reinstall operating system and you'll be all set. – Jay Sep 03 '10 at 17:00
  • 2
    I can't believe you two actually bothered to post those comments. –  Sep 06 '10 at 11:43
  • Key question here is "how are you transporting the files across machines?" – Wyatt Barnett Sep 07 '10 at 13:55
  • @Wyatt - they are zipped as one and copied over on a USB stick, no chance of an ftp-style bin/ascii screwup here. –  Sep 07 '10 at 15:29

4 Answers4

3

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.

Tomas Voracek
  • 5,886
  • 1
  • 25
  • 41
1

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?

jpda
  • 738
  • 5
  • 16
  • I am using the same project and solution files on both machines. The entire working directory was zipped up on computer A, moved to computer B, unzipped and the solution was opened in Visual Studio. No second solution was created. That is why its so baffling to me. –  Aug 24 '10 at 07:56
1

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

Community
  • 1
  • 1
mhenrixon
  • 6,179
  • 4
  • 40
  • 64
  • Its an interesting solution, but unfortunately Im not looking for a solution to the issue, I am more interested in the 'why' - in my mind, and identically configured VS2010 with the same solution and project files should not be acting differently - does anyone disagree? –  Sep 07 '10 at 10:00
  • I have experienced the same thing as you are but am still wondering why this happens! – mhenrixon Sep 07 '10 at 11:15
1

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.

Wyatt Barnett
  • 15,573
  • 3
  • 34
  • 53
  • Since the entire solution was zipped up and transferred between two NTFS filesystems, I doubt that hidden attributes would have been lost - but no, designer.cs files are not hidden files, they are there alongside the other files in the project. On your second note, good advice but my office uses SVN and I use git for personal projects at home, I don't feel like installing a second source control client on my personal kit just to grab stuff from work. –  Sep 07 '10 at 19:51
  • Ok, personally I'd just bite the bullet and do it but I'm crazy and have Git, Mercurial and SVN on any PC I do any significant development work from. – Wyatt Barnett Sep 09 '10 at 12:04