简体   繁体   中英

How can I determine the project type of a VB.NET ASP project?

I am having a heck of a time getting a legacy web site to build .

I get a "Object reference not set to an instance of an object." but with no indication of where that is (not) being done.

I could work through the literally thousands of issues found by Resharper:

在此处输入图片说明

...in the hopes that fixing one or some combination of them would finally clear that error, but I figure a more sensible approach is to create a new project, and gradually add in the custom folders and classes, etc. The question is, though, which type of project to create: ASP.NET Empty Web Site, ASP.NET Web Forms Site, or what?

How can I tell which type of project the non-working legacy one is, so that I can emulate that? Is the information hidden in some configuration file? Can I tell based on which type of files are contained in the legacy project?

It has the following folders:

App_Browsers 
App_Code
App_Data
A ton of custom folders (one for each customer), each of which has "Default.aspx" and "Default.aspx.vb" files within it.

Then there are gobs of *.aspx files, vwd.webinfo, web.config, and website.publishproj

EDIT

This is not a duplicate of that question, or at least the accepted answer doesn't seem to apply, because there don't seem to be any .xml files in this project.

UPDATE

I am gradually adding in folders and files from the legacy project into a new project, and seeing at each step if anything has broken. Here is the odd thing: It Rebuilds fine (1 succeeded, 0 failed, 0 skipped); but a Build results in 0 succeeded, 0 failed, 1 updated, 0 skipped... Why does a Rebuild succeed, whereas a Build neither succeeds or fails - just updates?

There isn't a rock solid, guaranteed way but I've used this list in the past to help. In your project file (not the solution file) you look at the <ProjectTypeGuids> node. The guids listed in the value of that node are what the project is using. I've been able to bring legacy projects (more) up to speed by trimming some things out of that.

https://www.codeproject.com/reference/720512/list-of-visual-studio-project-type-guids

Note that this doesn't necessarily mean that your code will compile or run if you port it directly to a new project created with different project types. Frameworks and API's change, obviously.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM