I don't understand why this problem occurs and need some assistance in solving it.
I have a web applcation in vs 2010 and I added a new module or web page, called CBValidate.aspx, to the project, built the solution and tested it in VS 2010 and all works as expected. However when I deploy it to the server and run the web page I receive
the following error:
The file CBValidate.aspx.cs does not exist.
I do not understand why this may happen. Could someone assist me in what to look for or why it may be happening.
You have to ensure that you copy all .cs files up to your hosting environment. The only time this doesn't apply is if you are using pre-compiled option.
Just wondering: If you added the page in VS with the option selected to not have a seperate code file, there would be no .cs file to deploy. The .aspx file would have a script tag section for the code behind methods, etc. Perhaps in your case this script
tag was removed or corrupted in some way.
I am fairly new to this development, so I don't understand. In my project I have many other .cs files and none of them show on my server. I build my solution, build a deployment package, and then do a publish to the web server.
So I am really confused now on what the difference is or what I am doing differently from before. Can you explain a bit more please.
So you're doing a publish to web server. Ok, then that means these files will be compiled dlls most likely. Check on your server in the BIN folder to see if you have any dll files with names that look like your cs pages. If not, you will need to copy the
dll files up to the production web server.
mfb
Member
16 Points
18 Posts
Can't find the the cs file for an aspx page
May 02, 2012 01:32 PM|LINK
Hello,
I don't understand why this problem occurs and need some assistance in solving it.
I have a web applcation in vs 2010 and I added a new module or web page, called CBValidate.aspx, to the project, built the solution and tested it in VS 2010 and all works as expected. However when I deploy it to the server and run the web page I receive the following error:
The file CBValidate.aspx.cs does not exist.
I do not understand why this may happen. Could someone assist me in what to look for or why it may be happening.
Thanks
Mike
bbcompent1
All-Star
33865 Points
8772 Posts
Moderator
Re: Can't find the the cs file for an aspx page
May 02, 2012 01:42 PM|LINK
You have to ensure that you copy all .cs files up to your hosting environment. The only time this doesn't apply is if you are using pre-compiled option.
RichardY
Star
8376 Points
1573 Posts
Re: Can't find the the cs file for an aspx page
May 02, 2012 01:48 PM|LINK
Just wondering: If you added the page in VS with the option selected to not have a seperate code file, there would be no .cs file to deploy. The .aspx file would have a script tag section for the code behind methods, etc. Perhaps in your case this script tag was removed or corrupted in some way.
mfb
Member
16 Points
18 Posts
Re: Can't find the the cs file for an aspx page
May 02, 2012 02:11 PM|LINK
Thank you for replying.
I am fairly new to this development, so I don't understand. In my project I have many other .cs files and none of them show on my server. I build my solution, build a deployment package, and then do a publish to the web server.
So I am really confused now on what the difference is or what I am doing differently from before. Can you explain a bit more please.
Thanks
Mike
bbcompent1
All-Star
33865 Points
8772 Posts
Moderator
Re: Can't find the the cs file for an aspx page
May 02, 2012 02:24 PM|LINK
So you're doing a publish to web server. Ok, then that means these files will be compiled dlls most likely. Check on your server in the BIN folder to see if you have any dll files with names that look like your cs pages. If not, you will need to copy the dll files up to the production web server.
mfb
Member
16 Points
18 Posts
Re: Can't find the the cs file for an aspx page
May 02, 2012 02:48 PM|LINK
I have checked the server bin and I have one large .dll file which has the name of the project. I do not have any other .dll files.
The thing is all the other web pages work fine, it is only the new one that reports it can't find the .cs file.
bbcompent1
All-Star
33865 Points
8772 Posts
Moderator
Re: Can't find the the cs file for an aspx page
May 02, 2012 02:51 PM|LINK
Try doing Rebuild of your solution or project.
mfb
Member
16 Points
18 Posts
Re: Can't find the the cs file for an aspx page
May 02, 2012 03:37 PM|LINK
I did a rebuild, published the site again and have the same problem
bbcompent1
All-Star
33865 Points
8772 Posts
Moderator
Re: Can't find the the cs file for an aspx page
May 02, 2012 07:39 PM|LINK
Hm, ok, could you copy the aspx.cs file up to your production server just to rule that out as a problem?
mfb
Member
16 Points
18 Posts
Re: Can't find the the cs file for an aspx page
May 03, 2012 12:39 AM|LINK
Ok I can try that. Where should it go on the production server.