-->

When you compile or run a Visual Basic application, the following types of errors can occur:

Error: MSB4024: The imported project file 'C: Users bhlee000 Documents Visual Studio 2017 Projects test.globalwarming.center testglobalwarmingcenter obj GlobalWarmingCenter.csproj.EntityFrameworkCore.targets' could not be loaded. Unexpected end tag. Line 25, position 4.

  • Compile-time errors, which occur when you compile an application.

  • Run-time errors, which occur when an application is running.

  1. 2021 Release Wave 2 Discover the latest updates and new features releasing from October 2021 through March 2022. 2021 release wave 2 plan.
  2. Regarding the phrase 'unexpected error', I agree this sounds like a tautology, but it is not really. VB can raise errors in situations which are expected e.g. When a file is missing. These are 'expected errors' and should be handled by specific code.

For information about how to troubleshoot a specific error, see Additional Resources for Visual Basic Programmers.

Error

Run-time errors

If a Visual Basic application tries to perform an action that the system can't execute, a run-time error occurs, and Visual Basic throws an Exception object. Visual Basic can generate custom errors of any data type, including Exception objects, by using the Throw statement. An application can identify the error by displaying the error number and message of a caught exception. If an error isn't caught, the application ends.

The code can trap and examine run-time errors. If you enclose the code that produces the error in a Try block, you can catch any thrown error within a matching Catch block. For information about how to trap errors at run time and respond to them in your code, see Try...Catch...Finally Statement.

Compile-time errors

If the Visual Basic compiler encounters a problem in the code, a compile-time error occurs. In the Visual Studio code editor, you can easily identify which line of code caused the error because a wavy line appears under that line of code. The error message appears if you either point to the wavy underline or open the Error List, which also shows other messages.

If an identifier has a wavy underline and a short underline appears under the rightmost character, you can generate a stub for the class, constructor, method, property, field, or enum. For more information, see Generate From Usage (Visual Studio).

By resolving warnings from the Visual Basic compiler, you might be able to write code that runs faster and has fewer bugs. These warnings identify code that may cause errors when the application is run. For example, the compiler warns you if you try to invoke a member of an unassigned object variable, return from a function without setting the return value, or execute a Try block with errors in the logic to catch exceptions. For more information about warnings, including how to turn them on and off, see Configuring Warnings in Visual Basic.

Thanks to all the replies and previous post about the elusive Error 50003
unexpected error. We got this error while trying to load the first form of
the application, and it would hose up memory. Worked fine on Win98 and NT, Microsoft visual basic unexpected error 50001 mac word
and seemed to work OK on Win95 with Office97.

We tried all the ideas about comctl32.DLL, OCXs, GIFs (as described on the
microsoft web site for this error code). Still did not work.

We were finally able to isolate it down to the form graphics (jpegs). It
only happened on the test machines which had low end video cards, and we had
256 color jpeg graphics. The reason Office97 made it work was that when it
runs the Office Assistant it loads DIBENG.DLL into memory. Which as I
understand is a 'device independent bitmap' graphics engine/driver.

Microsoft Word Visual Basic Unexpected Error (50001)

Our solution was to save our graphics as DIB files, which when loaded
automatically loads the DIBENG.DLL and the graphics are automatically set
according to the video capability.

Thanks agian for all the great ideas! We were really stumped and all your
ideas helped us to forge ahead and focus on some areas until we found the
culprit. THANKS!


> Help! Basic
> I am trying to run my VB application on a Win95 machine, but get this
Unexpected > error
> [Run-time error '50003' Unexpected Error]
> just before loading the first form. Using display messages debug, it
Microsoft > displays the mesages just prior to loading the form, but not the first
> message in the open form event. (I am displaying message boxes because

Microsoft Visual Basic Unexpected Error 50001

> the app runs fine on my NT development PC, but not on the user Win95
> PC).

Microsoft Visual Basic Unexpected Error 50001 Mac


Microsoft Visual Basic Unexpected Error 50001

> Overall, the app runs fine on an NT or Win98 machine, seems to be OK on
> a Win95 with Office97. But certainly does not run OK on a Win95 without
> Office.

> I've tried isolating missing DLL and OCX files to no avail. Any other
> ideas? Also, after installing memory monitor the app ran OK, too.
> Unfortunately the users can not have Office97 or other extraneous files
> loaded. I need to isolate the specific file incompatibility or
> whatever.

> Your help is much appreciated! Please reply to my e-mail as well as the
> group.

Microsoft Visual Basic Unexpected Error 50001 Mac Word

> Jeff Bryant