• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Asp.net code behind files lost in Plesk?

lg1382

New Pleskian
Server operating system version
Server 2016
Plesk version and microupdate number
Obsidian
My sites are hosted by Godaddy (for now) in their Windows / Plesk offering and when I logged into FTP the other day, I noticed all of my .cs files were not showing up. The .cs/code-behind files are the C# code that goes with the .aspx pages for those not familiar with asp.net. The aspx page is the html/javascript UI code, and the .cs file is the server-side code for the page.

Anyway, I immediately checked my site to ensure it was still functional and to my surprise it was. The code behind files are not optional for my site to function, they need to be there. Since the site works, it leads me to believe they are on the server and are working... but they do not show up in FTP or in the Plesk File manager.

I have multiple sites and some are affected and others are not. The only thing I can think of is the maintenance Godaddy did a few months ago where they updated Plesk. My sites are informational in nature and don't require much in the way of maintenance so I don't check on them often but I believe something was corrupted or didn't copy correctly when they did their maintenance. Godaddy support is of no help and they insist it's something I did wrong but I haven't touched my site's contents for about 15 months.

In the Plesk site settings, I have verified the folder path to my site's files a dozen times and where the domain is pointed simply does not have my .cs / code-behind files listed. I do see at the root of my file structure there is a "tmp/root/<8 character random folder name>" directory that I did not place there. There are dozens of the 8-character named folders with a ton of ".compiled" and .dll files in them. I'm guessing this was some remnant of their upgrade maintenance as I definitely did not place these files here. My guess is the upgrade script bombed out for some reason and needs to be redone or repaired but I am not the admin for the server to perform this... Godaddy would have to do it I presume.

So, as far as I can tell, the files are on the server and Plesk is able to serve them / use them - but I cannot see them anywhere in my FTP or Plesk File Manager. Godaddy refuses to troubleshoot or open a support ticket directly with Plesk. Hoping I can get some ideas or support here. If not, I'm looking for a new host where I have more control.

Any ideas on how to trace where these files are or where they are being served from?
 
I am not an ASP.NET expert, but as far as I know, C# is a compilable language and does not need source code - .cs files. That's why your site works. Where did the source files go it is hard to say. Apparently, someone deleted them. Plesk himself could not do it.
 
Igor - thanks for your reply.

My site is built using ASP.NET Web Forms. In simplistic terms, there is the html and javascript markup that reside in an .aspx file. Those files either have C# (or VB if the developer prefers) directly inside of them inline, or more commonly, they have an aspx.cs (or aspx.vb) "code-behind" file. Each web page has a markup file and a code file and the naming is Default.aspx, and Default.aspx.cs. The webserver uses the code-behind file to perform server-side tasks (think database queries) and then the server will use the aspx page to render the html that gets sent back to the browser. That's Web Forms in a nutshell... it's similar php in that php is a template with inline server-side code. With web forms, you can extract the C#/VB code into a separate file... and those files are what I cannot find anywhere since Godaddy upgraded Plesk.

Bottom line, my site would absolutely break if the code-behind files for my pages are truly missing - there is no question about this, it's a certainty.

What I can't explain is all of the compiled files in the tmp directory. I'm not familiar with .compiled files and they are definitely not something I created or placed into my directory structure. My hunch is that webservers maybe do some compilation of the aspx/asxp.cs files and use those under the hood but if so, that is all extracted away from the developer. For the last 2 decades, I've only had to create aspx and aspx.cs files for my site and then standard web.config files. Since my sites are set-it-and-forget it, it's way too coincidental that I have missing files after a Plesk upgrade - yet the sites still function. I don't know if Godaddy upgraded Plesk in place or if they copied everything to new hardware or what... but it's frustrating when you point a domain to a directory in Plesk and expected files are not there yet the site is still functional.
 
This is normal.
Your .cs code is compiled into included DLLs so that the source itself is not easily hackable.
All you should see are your aspx files. They know where to find the correct DLL to utilize with them.
That's why your site is still working.

You CANNOT use the website as the "backup" to the source code.
You have a PUBLISHED version of the program as the website, not the program itself.

Hope that makes sense.
 
Back
Top