I am studying vb.net through the help received through this forum. While I was making a small programme Out of curiosity/error
I created a module.later I thought it is not necesssary.So I wanted to remove it.I searched in the project Tab But I could not see the Delete command.So I closed the project and opened the folder where the files are stored and deleted the module,But after that the programme is not working.
1.Whether I have done it properly ?
2.If not how can we remove the module from the project? (In the project tab only ADD provision is there)
3.After removing how can we know whether it is realy gone form the project?
Thanks in advance...

Dani AI

Generated

Short answer for : deleting the .vb file from Windows Explorer breaks the Visual Studio project because the project file (.vbproj) still expects that source file (or the deleted module provided the startup Sub Main or shared members). The safe way is to remove the module from inside Visual Studio so the project and disk state stay in sync.

Steps to remove a module correctly

  • In Solution Explorer right‑click the module (.vb) and choose Delete to remove it from both project and disk, or Remove to take it out of the project but keep the file on disk.
  • If the file was already removed externally and Visual Studio still lists it (or shows build errors), unload the project and edit the .vbproj: remove the <Compile Include="..."> line for that module, save, then reload the project. Example entry to remove:
    <Compile Include="Module1.vb" />
  • Alternatively, restore the file from Recycle Bin or source control, then use Visual Studio to delete it properly.

Fixes when the program stops working

  • Check Project → Properties → Application → Startup object. If the deleted module held Sub Main the startup object must be changed to an existing form or Sub Main replacement.
  • Rebuild and inspect the Error List for missing members or types that other files still reference; use Find in Files to locate references and update or remove them.
  • If the project still has missing-file entries, a clean/reload or editing the .vbproj as above will remove stale references.

Best practice note: always remove project files from within Visual Studio or use version control so accidental deletions can be restored easily.

Sorry I Got the answer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.