Vb.net Solution Explorer

Hi,

I'm trying to clean my solution explorer by placing forms in their own folders, reports, classes and so on. I'm worried that doing this though will create problems in my application because now the forms will be in different folders. I think once I did this and a couple days later my whole app was confused where the forms went.

Is there a correct way to do this, do I need to clean-up or rebuild the app or something after I placed all the forms in their respective folders?

Thank you
FCapoAsked:
Who is Participating?
 
Jacques Bourgeois (James Burger)PresidentCommented:
As long as you do the job in the Solution Explorer itself and not in Windows/File Explorer, this is OK because Visual Studio understands what you do when you reorganize the files and folders through it.

You can create folders in Solution Explorer with a right click. You then drag the files to the folders where you want them.

The same approach also works if you want to remove or rename files. Doing it in the Solution Explorer is OK, but doing it from outside of Visual Studio can lead to warnings.
0
 
it_saigeDeveloperCommented:
*No Points*

Bear in mind that the display in Visual Studio Solution Explorer is *strictly* for your benefit.  So as James has stated, use the Visual Studio Solution Explorer to make these changes.

To add onto what James stated, as long as you do not also change the namespaces on these files, then there will not be a problem.

-saige-
0
 
FCapoAuthor Commented:
Hi,

After putting all my reports in one folder, I get the following error when trying to open up a form that has a report :

Unable to find the report in the manifest ressources. please rebuild the project and try again
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jacques Bourgeois (James Burger)PresidentCommented:
Visual Studio "follows" the items that it uses itself during compilation, but it cannot handle  stuff that you define implicitly in your code or that are added by third party components.

Report generators are not part of Visual Studio. They are add-ins that incorporate themselves into VS. As many third party tools, many of them do not integrate themselves completely. Some will insist on a direct or relative path in order to find the report, without following the changes that are made to the solution.

For these, you might have to change the location in your code or in the designer that you used to create the report. Or bring them back in the original location.

What type of reports are you using?
0
 
FCapoAuthor Commented:
Hi,

I'm using crystal reports;

It's just very messy to leave all these reports in the root folder, I was hoping to do a little cleaning up
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
Click on one of your report files and give a look at the Build Action in the properties Window.

If the property is set to Embedded Resource or Content, you can usually move the files around without any problem in the Solution Explorer. I have stopped using Crystal eons ago, but last time I checked, around 2008, these mechanisms were the ones that were suggested, depending on whether you wanted the user to be able to edit the report or not.

But there is also another way of working with external files, and this one does not follow the files when you move them around. If the Build Action is set to None, then the files might be incorporated into the build through that other mechanism.

Before doing the following, make a copy of your project. If somebody manually changed the name of the resources (by default it is matched with the file names), this could cause problems in the application later.

Open the Project's Properties window and go to the Resources tab. Look for your report files in there, probably under Files in the ComboBox at the upper left corner of the window. If so, move your files in your new directory. They will then be flagged with an error icon in the Resources window because it lost its trace. Remove all those from the window (you can Ctrl-Click or Shift-Click to select them all). Grab the files in the new directory and drag them to the Resource window. They will be referenced with the new path and your application should build.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.