Question Muti-Project Solution won't build?

techwiz24

Well-known member
Joined
Jun 2, 2010
Messages
51
Programming Experience
Beginner
I keep getting this dang error every other time I try to build my solution! I have to remove the problematic project and add a new one and clone the forms! Error is:


Error 1 Could not load file or assembly 'file:///C:/Users/Administrator/Documents/Visual Studio 2010/Projects/project_name/ext_gdg/bin/Debug/ext_gdg.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 138, position 5. C:\Users\Administrator\Documents\Visual Studio 2010\Projects\project\project_name\Form1.resx 138 5 Project_Name
 
Those paths look a little strange in relation to each other:
VB.NET:
C:/Users/Administrator/Documents/Visual Studio 2010/Projects/project_name/[COLOR="red"]ext_gdg[/COLOR]/bin/Debug/ext_gdg.exe
VB.NET:
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\[COLOR="blue"]project[/COLOR]\project_name\Form1.resx
Normally you would start with the root project folder, which would be:
VB.NET:
C:\Users\Administrator\Documents\Visual Studio 2010\Projects
Then there would be a folder for the solution and then a folder for the project:
VB.NET:
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SolutionName\ProjectName
That's where your source files should be, including that RESX file. Under that should be the root output folder and then the output folder for each configuration:
VB.NET:
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\SolutionName\ProjectName\bin\Debug
That's where your output should be, including the EXE, unless you changed the output path, which there really is no reason to do. That would explain why the error message says it can't find something at the location it expects. Do you have any explanation why the normal paths aren't being used?
 
My project FileSystem is set up like so:
VB.NET:
{VS 2010 Projects Dir}
   Master Project (Master solution, what ever)
       Project 1 (main)
       Project 2 (gui)
       Project 3 (console)
I made a mistype. All files are now in correct spots and I still get errors. I tried making yet another project in the solution because all three projects share a .dll, I tried making a .dll to do the work for those three projects, but that didn't work either. I'm just mad. I've been working on this for about a month and a half now, and it was fine up until I got the console (Project 3) working... basically, thats a console version of project 2, and they are independent of project 1, because they allow the user to create files that are compatible with project 1. Any suggestions?
 
It sounds like the RESX file for Form1 has become corrupt. A RESX file is an XML resource file. I don't know how this happens and, if you understand the files properly (which I don't) then you may be able edit it by hand to fix the issue. When this sort of thing happens to me, what I do is drag the offending form to a different project in the Solution Explorer. This creates a copy of the form and seems to regenerate the RESX file. If this requires me to add a new project to the solution then that's what I do. Once I confirm that the form will build and run in the other project, I delete the original form and drag the copy back into the original project. I then delete the copy and, if it was temporary, the project it was in. That's worked for me more than once.
 
Ok, so here's what I did. Made new blank solution named master. added project 2 and 3 from previous project, and built, worked fine. added project 1 and built, worked fine. as soon as I added the line under a button click:
VB.NET:
Dim other_gui as New ext_gdg.Form1
other_gui.Show()
it won't build anymore, same error...now what???
 
Back
Top