An old ASP.NET WebForms app won't build due to missing references and related

Falanga, Rod, DOH 80 Reputation points
2024-05-08T21:06:30.9666667+00:00

I maintain an old ASP.NET WebForms application, written using VB.NET so long ago that no one knows who started this application. The guy who maintained it, before I was given it, left before I joined. He didn't put anything in any source control, and he had his PC reimaged. So, I had to piece the thing together from bits and pieces he left scattered around our network.

I've been trying to get this to build using a GitHub self-hosted runner on one of our servers. I had a lot of errors, which with help here on Microsoft Q&A, I've been able to reduce most of the errors. The errors I've got left are related to building the app and some odd ones related to Visual Studio. (I am using VS 2022.) Here are the errors:

Severity Description Project File
Error could not find library 'C:\GitHub\Prod\FP_Timetrack\WicReports\bin\WicReports.dll' WicLibrary C:\GitHub\Prod\FP_Timetrack\WicLibrary\vbc
Error could not find library 'C:\GitHub\Prod\FP_Timetrack\WicReports\bin\WicReports.dll' timetrackreports C:\GitHub\Prod\FP_Timetrack\timetrackreports\vbc
Error Could not get dependencies for project reference 'WicReports' TimeTrackSite
Error Could not get dependencies for project reference 'timetrackreports' TimeTrackSite
Error Could not get dependencies for project reference 'WicLibrary' TimeTrackSite

First off, I don't understand the first two errors at all. I have removed the reference to the WicReports.dll, twice. Then put in a reference to the VB.NET WicReports project. But each time Visual Studio puts back in the link to the DLL! Why??Second problem, I don't get the third, fourth, and fifth errors. As you can see, there's no referenced file. And it looks even weirder in Visual Studio solution:

User's image

As you can see, there IS no References folder with references in it, as there are in all the other projects in this Visual Studio solution. TimeTrackSite is the web app, the other 8 projects are helper projects for this convoluted application. So, how do I fix this?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,317 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,698 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 49,251 Reputation points
    2024-05-08T21:34:00.7933333+00:00

    Do you have all this in a project file or are you just browsing the folder structure in VS? You are going to need a web project to support this. A long, long time ago VS supported creating web sites by just using a folder but this was basically abandoned. If you do not yet have a web project then create a new web project first. Otherwise none of this is going to work.

    What version of the framework was the site written for (it'll be in the project file if you have it or the web.config otherwise). You'll need to upgrade it to at least NET Framework v4 before VS will even remotely want to do anything with it.

    I don't know what the WicReports binary is (third party? project?) but it appears it was a third party binary that the code referenced. If you have the site running now then that binary is wherever the site is running at. If not then find the binary and put it into a folder in the project (e.g. libraries). Then in the project's references in Solution Explorer remove any references to this binary under References and then add a binary reference to the version in your new folder. Note that I'm assuming the old binary is compatible with NET Framework v4, if it isn't then things aren't going to work.

    Your remaining "could not find references" indicates to me that you don't have a project file so adding one will fix that.

    If you have to create a new project file then you'll need to move all the existing code into it. By and large you can copy all the .aspx/.aspx.cs/etc files directly into the project by dragging and dropping them. All the code under App_Code, content, etc can also be done that way. The files under App_Data are likely just data files so you'll have to review them. If there are files there then either you'll need to copy them as well or they will need to be recreated (e.g. a database). For the config file you'll need to merge any customizations in the original file with what is now in the project. This is a line by line process. After you've done all that then try to build again.

    As a final note, if you were targeting pre-NET Framework v4 in the old code then migrating to NET Framework 4 (required by VS) will require yet more changes.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more