RodAtWork avatar image
0 Votes"
RodAtWork asked YijingSun-MSFT commented

Is it possible to generate a Global.asax.vb file from an empty Global.asax file?

I maintain an old ASP.NET WebForms app written by someone else who left before I came onboard. The original developer didn't put the source code into any version control system (VCS). I've been trying to get it organized into TFS, which is what they use here. During that attempt I began to get error messages from Visual Studio 2019 or TFS (I'm not sure which) related to different things. The most recent is an error saying that it couldn't find the Global.asax.vb file. I've looked for it, too. There is no Global.asax.vb file anywhere that the original developer left his code. (He left the code for this project scattered about the network. I looked everywhere I know of.) The Global.asax file is empty (zero bytes). Is it possible to create a Global.asax.vb file from an empty Global.asax file? If so, how do I do it?

· 10
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is it possible to generate a Global.asax.vb file from an empty Global.asax file?

Can you clarify your intentions? Clearly, it is not possible to pull code out of the air but you can add a code behind file.

What kind of project is this; Web Site or Application? What is the error actual message and what are the steps to reproduce the error?

0 Votes 0 ·

When I try to check the source code into TFS, the error that's raised is:

Could not find file 'D:\Website\FP_Time_Tracker\Timetrack\TimeTrackSite\Global.asax.vb'

When I try to build the project in VS 2019, I get several errors about improperly defined imports, but the relevant one for this discussion is:

Unable to create a manifest resource name for "Global.asax.resx". Could not find file 'D:\Websites\FP_Time_Tracker\Timetrack\TimeTrackSite\Global.asax.vb'

As to what sort of project this was, I have no idea. The original developer didn't put it into TFS. He didn't leave any notes. He left parts of the solution here and there. The whole solution is comprised of 10 VB.NET projects, which took me weeks to hunt around and find, since he would put 2 in one network share, 3 in another network share on a different server, etc. It took me about a month to get it so it would finally build. At that time, I did a poor job of architecting the project, especially for inclusion into TFS. (Not all projects are in TFS, that's my fault, but when I started, I'd only just learned about TFS.) Therefore, I'm trying to make it into a coherent Visual Studio solution that's also all within TFS. I never found the original developer's .sln file, so I don't know if he'd made it a Web Site or a Web Application. I made the current WebForms project a Web Application. (After I got it to build, I added some unit test projects written in C#, since I'm more comfortable with C# than with VB.NET.)

0 Votes 0 ·

Hi @RodAtWork ,
As far as I think,there is no possible to generate one Global.asax.vb file from an empty Global.asax file. It normally reside in the root folder of your application. I think there is an effective but troublesome way that you could create a new project and migrate your codes to the new project.
Best regards,
Yijing Sun

0 Votes 0 ·
Show more comments

Take a look at the hosted application (IIS). If the hosted site has vb files then it is a web site project and you should find the global.aspx.vb file. Otherwise; you have a web application. You are out of luck if you cannot find the source code for a web application project.

0 Votes 0 ·
Show more comments

0 Answers