1

I've been handed the code for an older VB program built in VS2010Pro to update. I'm not an experienced VB or .NET programmer and haven't worked in any Microsoft development platform since the 90's, so the vagaries of VS .NET builds are a bit of a mystery to me.

Trying to build, the code compiles successfully, but when run in the debugger, it throws an error at startup about an assembly load fail, and the IDE displays a msg in the bottom status bar: "Downloading source code from http://referencesource.microsoft.com/Source/01590.00/Source///vb/runtime/msvbalib/ApplicationServices/WindowsFormsApplicationBase.vb...". Closing the error dialog shows a "No Source Available" screen with the call stack location and a list of locations (including a "f:\dd..." location that doesn't exist locally and I assume is an attempt at a source-control lookup) and the source server reference, and a final "The debugger could not locate the source file" message.

So, the questions:

1) I've tried a raft of ways to locate this file online, without success. From what I am seeing, though, there are a bunch of other people in this exact same situation, and no one is getting an answer, from MS or any other source. Can someone who has this file and its sisters PLEASE make them available???

2) The MS source server seems to not work. Has MS moved this stuff? If so, how do I tell VS2010Pro to look in the new location?

3) (to the universe at large) This is a core part of the .NET library for VB. Why isn't it included in the primary distribution disk? Sometimes I think MS does this kind of thing just to drive people to upgrade... :(

SteveS
  • 335
  • 1
  • 13
  • 1
    It is looking for source code of a .NET assembly. This is usually *not* what you want to be stepping through in the debugger. – djv Jan 30 '18 at 16:16
  • 1
    If it is not already there, try adding a reference to Microsoft.VisualBasic.dll: https://stackoverflow.com/a/21212268/832052 – djv Jan 30 '18 at 16:20
  • 1
    Check Your Project >> References - for any references with an (!) which may be missing or the wrong version. Check any post-build events by doing Project >> Properties >> Compile >> Build Events – djv Jan 30 '18 at 16:23
  • 1
    Lastly, you can step into your code in the debugger (F8), instead of running it. Step line by line in your own source code until something breaks – djv Jan 30 '18 at 16:24
  • The DLL exists in the specified path. There's no reference entry for it in the project, and trying to add one fails with a "this component is already automatically referenced by the system" message. The imported-namespaces entry for it is checked. Lastly, F8-ing into the code errors before the first line of source is reached with a "missing mscoreei.dll" error, and that DLL does exist in a referenced path. – SteveS Jan 30 '18 at 19:53
  • Removing the .SUO files for the project fixed the startup issue. Thanks! – SteveS Jan 30 '18 at 20:28
  • Spoke too soon - see comment below. :( – SteveS Jan 31 '18 at 15:24

1 Answers1

1

It sounds like you're missing the reference to Microsoft.VisualBasic.dll as WindowsFormsApplicationBase is a part of the Microsoft.VisualBasic assembly.

Check to see if you have that dll at Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 or whichever v4.* you have (I think v4.0 is tied to VS2010).

If the dll exists, which it most likely will, then you need to check if Microsoft.VisualBasic is a reference in your project by expanding "References". If it's there, right click and click on properties and see what "path" it's using.

If the reference is not embedded into your project, you need to go down the list of "call stack location and a list of locations" and see why the dll is not there.

A couple of other links that may help:
Deleting SUO (Specific User Options) which is probably why it's looking in f drive: https://social.msdn.microsoft.com/Forums/vstudio/en-US/c5cac77e-83f4-49c5-b08c-a9f78b644843/finding-where-projectdatavb-is-located?forum=vsdebug

https://social.msdn.microsoft.com/Forums/vstudio/en-US/7fb27a1c-eb36-4867-9d08-6e2c9324835f/why-is-source-path-fspvctoolsvc7libsshipatlmfcsrcmfcdlgpropcpp?forum=vcgeneral

Why is Visual Studio 2010 not able to find/open PDB files?

I hope something works.

nugenjs
  • 155
  • 2
  • 10
  • 1
    *.suo = Solution User Options – djv Jan 30 '18 at 19:59
  • The DLL exists where you noted. There's no entry in the references list for it, but it's checked in the "imported namespaces" list. When I try to add a reference to it, I get an error about it being already automatically referenced by the system. I'll try deleting the .SUO. – SteveS Jan 30 '18 at 20:02
  • 1
    OK, I moved all the related .SUO files to another folder and now the app runs through startup. There are other problems - can't find a couple of referenced OCXes - but I should be able to sort those. Thanks much! – SteveS Jan 30 '18 at 20:27
  • Spoke too soon. :( I'm building for an x86 target - have to, as the app calls 32bit OCXes. Removing the SUO caused the IDE to switch back to "Any CPU" without me noticing. The app builds and runs when set to AnyCPU, but throws the same errors as before when built for x86 target. So I'm at a loss again... – SteveS Jan 31 '18 at 15:20
  • @SteveS It seems like you have a reference to a 64 bit assembly somewhere – djv Jan 31 '18 at 15:43
  • Hmmm... I've used CorFlags to scan all the folders containing any references listed in the project's reference list. Everything returns as AnyCPU with the exception of 2 interop DLLs that return as x86. Can there be other assemblies that it's referencing that aren't included in the references list? – SteveS Jan 31 '18 at 22:01
  • At this point, we can only shoot in the dark. It'll help if you give us a log of what directories the app is looking through. [VS2010 Express can only compile 32bit and need to install MicrosoftSDK](http://customers.zemax.com/os/resources/learn/knowledgebase/compiling-a-64-bit-application-in-microsoft-visual). I was building a build server with minimal installations and noticed I couldn't build in AnyCpu. I think the fix was that I installed Microsoft SDK, installed NetFramework Target/Dev Pack, and/or created "C:/Program Files (x86)/Reference Assemblies" which was missing for me. – nugenjs Feb 01 '18 at 00:58
  • Whoops, I read your comment wrong, and thought you were building for 64bit. Another thing to check. See if you have `C:/Windows/Microsoft.NET/Framework` and `C:/Windows/Microsoft.NET/Framework64` exists and that they contain the required framework versions. [Installs the files needed to run](https://www.microsoft.com/en-us/download/details.aspx?id=6523) . [Empty Symbols Cache](https://stackoverflow.com/questions/2806993/no-source-available) – nugenjs Feb 01 '18 at 04:36
  • Sorry to be slow getting back to this - been out with the flu for a few days. Nugenrules, this is Vs2010 Pro, not Express, and I'm building for a 32-bit target (the previous version of this app, built for AnyCPU, won't run on a 64-bit platform because it calls 32-bit OCXes, and it's getting difficult to source 32-bit Windows versions.) The paths you note do exist, but I'm not sure whether they contain *all* the necessary files. – SteveS Feb 07 '18 at 13:27