Fix: ‘Object Reference Not Set to an Instance of an Object’ Error in Windows

The Object reference not set to an instance of an object error is a common Windows issue that arises from Microsoft Visual Studio. This error occurs when a Visual Studio object is either absent, assigned as null, or inaccessible.

Object Reference Not Set to an Instance of an Object on Windows

Interestingly, this problem isn’t exclusive to Microsoft Visual Studio developers, as it may also pop up with other applications that rely on Visual Studio dependencies. Below are some likely causes of this issue:

  • Missing Windows 1803 Update on Windows 10 – For users of Windows 10, this problem might arise from a conflict between system drivers and installed touchscreen devices, commonly on Surface devices. The 1803 update remedied this issue, so be sure to install it if you haven’t yet.
  • Corrupted Visual Studio data – The issue could stem from corruption in your current user data within Microsoft Visual Studio. To address this, reset the associated user data on your account.
  • Inadequate Microsoft Visual Studio permissions – This error might occur if Microsoft Visual Studio lacks necessary permissions to modify files. Grant the application administrator access to solve this.
  • Conflict caused by the Touch Keyboard and Handwriting Panel Service – For users with touchscreen devices, the Touch Keyboard and Handwriting Panel Service could be the conflict source. Testing the theory involves temporarily disabling the service.
  • Outdated Microsoft Visual Studio version – Encounter this error after importing a new project into Visual Studio? The issue could be due to using a version that’s incompatible with the project. Update your Visual Studio to rectify this.
  • Outdated Microsoft Visual Studio extensions – If your projects utilize Visual Studio extensions, ensure they are all updated since outdated extensions may trigger this error.
  • Missing ASP.NET or Web Tools dependency – Experiencing this error while trying to open projects that use Web Tools and ASP.NET dependency? Make sure these dependencies are installed on your system.
  • Vault Server issue – If accessing your AutoDesk Vault prompts this error, verify that the critical Vault services are operational.
  • Corrupted local Vault Client profile – A corrupted current Vault user profile might also cause this problem. Deleting your local Vault User profile may resolve this.
  • Outdated Vault version – Ensure that you’re using the latest Vault deployment package locally to avoid this error when accessing your AutoDesk Vault.
  • Corrupted Vault installation – The error may result from broader corruption within your local Vault installation. A reinstall might correct the issue.
  • Antivirus or firewall interference – Overzealous antivirus software might mistakenly block Vault executable from running properly, thus causing this error. To resolve, whitelist the executable or uninstall the interfering software suite.

1. Install the 1803 Update (Windows 10 Only)

This error occasionally appears when loading the Juris® Suite Inquiry on Windows 10 Professional Edition. After investigating, it was determined that a Windows Update was responsible, which was subsequently resolved by the hotfix in Windows Update 1803.

If you haven’t yet installed the 1803 update on Windows 10 and are facing this issue, updating should resolve the problem, provided that this is the underlying cause.

  1. Press Windows key + R, type “ms-settings:windowsupdate” and press Enter to access the Windows Update tab in Settings. 
    Access the Windows Update component
  2. In the Windows Update screen, click Check for Updates
    Check for Updates
  3. Install any pending updates. If there are multiple updates, you might need to restart your computer to complete the installation process. Follow any restart prompts but be sure to return to this screen to finish the updates after the initial restart.
  4. Upon completing updates, reboot your computer one final time to determine if the Object reference not set to an instance of an object error persists.

2. Disable the Touch Keyboard and Handwriting Panel Service (if applicable) 

Many users who faced this problem have resolved it by disabling the Touch Keyboard and Handwriting Panel service.

Warning: This procedure will affect the use of any connected touchscreen device. Do not proceed with this method if you rely on a touchscreen device like Microsoft Surface, as this will disable touchscreen functionality.

  1. Press Windows key + R, type ‘services.msc’, and press Ctrl + Shift + Enter to open the Services screen with administrator access.
    Open up the services screen
  2. At the User Account Control (UAC), click Yes to grant admin access. 
  3. Within the Services screen, find and right-click the Touch Keyboard and Handwriting Panel service. Choose Properties from the context menu. 
    Accessing the Properties screen
  4. In the Properties window, use the General tab to set the Startup Type to Disabled, then click Apply to save your changes. 
  5. Restart your PC and replicate the action that used to cause the “Object reference not set to an instance of an object” error to see if the issue has been resolved.

3. Reset Visual Studio user data

User data can sometimes be the root cause of the Object reference not set to an instance of an object error. Resetting all Visual Studio-related user data is necessary for fixing this.

Note: Be aware that this process can reset your user settings, such as the Visual Studio layout, linked Microsoft account, or start page, among others.

  1. Ensure that Visual Studio is completely shut down and not running in the background.
  2. Open File Explorer and navigate to:
    C:\Users\%userprofile%\AppData\Local\Microsoft\VisualStudio
    Accessing the Visual Studio User Profile
  3. Clear the folder by selecting all items, right-clicking, and selecting Delete.
  4. Restart your PC, then open Visual Studio to check if the problem has been resolved.

4. Run Microsoft Visual Studio with the required Permissions

Another possibility leading to this issue is a lack of permissions for Microsoft Studio to edit project files. This is particularly prevalent on Windows 10, where the development environment typically does not launch with administrator rights by default.

Fortunately, you can compel Microsoft Visual Studio to launch with the necessary permissions by configuring your OS to start it with administrator rights.

  1. Click the Windows key, then type Visual Studio in the search bar at the top.
  2. Right-click on Visual Studio in the search results and choose Open file location from the contextual menu.
    Open the file location of Visual Studio
  3. Right-click on Visual Studio in the location window and select Run as Administrator from the menu. 
  4. After ensuring that Visual Studio has started with the necessary permissions, perform the action that was causing the error to see if it has been resolved.

5. Update Microsoft Visual Studio

Microsoft consistently releases updates for Visual Studio to fix common bugs and errors. The “Object reference not set to an instance of an object” error could potentially be resolved by an update if it’s related to a known issue. Hence, keeping Visual Studio up to date is essential to avoid such errors.

Even though Visual Studio typically notifies users when a new update becomes available, it’s a good practice to manually check for updates occasionally, in case you missed a notification.

  1. Press the Windows key and enter ‘Visual Studio Installer‘ in the search box. 
  2. Click on the Open button associated with Visual Studio Installer in the search results.
    Opening the Visual Studio Installer
  3. When the Visual Studio Installer utility launches, wait until it checks for updates automatically. If a new version is detected, an Update button will appear.
  4. Click the Update button and follow the on-screen prompts to install the available update.  
  5. Reboot your PC and check if the “Object reference not set to an instance of an object” error has been resolved after the next startup.

6. Update Microsoft Visual Studio Extensions

Even with the latest version of Microsoft Visual Studio, the error might persist if any extensions you use are outdated.

Should you rely on Visual Studio extensions for your development, ensure every extension is up-to-date by following the steps below:

  1. Open the project experiencing the issue.
  2. Once the project is loaded, use the ribbon bar at the top to click on Extensions and from the dropdown menu, select Manage Extensions.
    Managing the extensions
  3. In the extensions tab, check if any Visual Studio extensions need updating. If updates are available, click on Update all and approve the process.
    Update the available Visual Basic extensions
  4. After installing all available updates, restart the application and verify if the “Object reference not set to an instance of an object” error has been resolved.

7. Install Microsoft ASP.NET and Web Tools

Microsoft ASP.NET and other web development tools are used to create dynamic web pages, which can help prevent errors. If these dependencies are missing, installing them may automatically fix the issue.

Visual Studio simplifies the installation of missing Microsoft ASP.NET and Web Tools dependencies.

  1. Start by opening Visual Studio and loading the project that’s causing the problem.
  2. Using the ribbon bar at the top, navigate to Tools > Get Tools and Features.
    Accessing the Get Tools and Features
  3. In the Get Tools and Features window, tick the box next to ASP.NET and web development, then click on Install while downloading.
    Installing the ASP.NET and web development dependency
  4. Once the installation completes, restart the application and check if the problem persists.

8. Check for a Vault critical server issue (if applicable)

When you’re facing this problem while trying to utilize the Vault server infrastructure provided by AutoDesk, the error may be a result of a technical hiccup with the critical services that underpin the Vault Servers.

To determine whether this is the cause of your issue, the following instructions will guide you through checking if the essential services are running:

  • Autodesk Data Management Job Dispatch.
  • SQL Server (AUTODESKVAULT)*.
  • SQL Server Agent (AUTODESKVAULT)*.
  • Windows Process Activation Service.
  • World Wide Web Publishing Service.

If any of the above services are not operational, you need to start them manually.

  1. Log into Windows on the Vault server computer and press Windows key + R to bring up the Run dialog box. 
  2. In the Run box, type ‘services.msc’ and press Ctrl + Shift + Enter to open the Services screen with administrative privileges. 
    Open up the services screen
  3. Now, in the Services Management Console, look at the status of the following services and make sure each one is active:
    Autodesk Data Management Job Dispatch
    
    SQL Server (AUTODESKVAULT)*
    
    SQL Server Agent (AUTODESKVAULT)*
    
    Windows Process Activation Service
    
    World Wide Web Publishing Service
  4. If any service is not currently active, right-click on it and select Restart.
  5. After restarting every necessary service, attempt the action that was previously causing the error to see if the problem has been remedied.

9. Delete the Local Vault Client Profile (if applicable)

Corruption affecting the Vault user profile is another potential cause that can trigger the “Object reference not set to an instance of an object” error when using Vault Servers.

If this situation applies to you and you haven’t tried this solution yet, you will need to delete every Autodesk folder containing user data.

IMPORTANT: Make sure the main application is closed before proceeding with the deletion of the following folders. Once ready, remove these folders to clear the data tied to the Vault Client Profile:

  • “%APPDATA%\Autodesk\VaultCommon”
  • “%APPDATA%\Autodesk\Productstream 20xx”
  • “%APPDATA%\Autodesk\Vault Explorer 20xx”
  • “%APPDATA%\Autodesk\AutoCAD 20xx Vault Addin”
  • “%APPDATA%\Autodesk\Autodesk Vault Basic 20xx”
  • “%APPDATA%\Autodesk\Autodesk Vault Workgroup 20xx”
  • “%APPDATA%\Autodesk\Autodesk Vault Professional 20xx”
  • “%APPDATA%\Autodesk\Autoloader”
  • “%APPDATA%\Autodesk\Reference Repair Utility”
  • “%APPDATA%\Autodesk\Inventor 20xx Vault Addin”
  • “%APPDATA%\Autodesk\VaultManager”

Note: Deleting these folders will not affect the functionality of the Autodesk app. They will be recreated the next time the application is launched.

10. Update Vault Version (if applicable)

In some cases, AutoDesk users have reported the issue appearing when their Vault products were not updated to the most current version.

To ensure you’re running the latest version, visit the official Vault Download page and download and install the latest available build.

11. Uninstall and Reinstall Vault (if applicable)

Experiencing issues with Vault software may require you to repair, reinstall, or uninstall Vault Server, Vault Client, or Vault integration for a CAD product, depending on what’s applicable to your situation.

This method is relevant when Autodesk software is showing inconsistency, and there’s a belief that corrupted local installation components are disrupting Vault integration.

Note: This step is only pertinent for those using Autodesk Vault (Server, Client, or CAD integration). If you’re not using Vault, skip this method and proceed to the final fix.

Depending on where the corruption originates, one of the following sub-guides below should help resolve the error.

Uninstall and Reinstall the Vault Client

There are several indicators pointing to potential corruption within the Vault Client from Autodesk, including inconsistent software versions, false positives, and corrupted components.

  1. Press the Windows key + R to open up a Run dialog box.
  2. Type ‘appwiz.cpl’ into the box and press Enter to open the Programs and Features menu.
    Open up the Programs and Features menu
  3. Locate Vault Basic, Vault Workgroup, or Vault Professional (Client) in the list, right-click on the entry, and select Uninstall.
    Uninstall the Autodesk vault
  4. In the uninstallation window that appears, select Uninstall from the available options and follow the prompts to complete the process.
    Starting the Autodesk Vault uninstallation process
  5. After uninstallation, visit the installation directory of Autodesk Vault and delete any remaining files.
  6. Restart your computer and then reinstall the software from the original installation media or download it afresh.

Uninstall and Reinstall the Vault Server

If software behavior suggests possible corruption within Vault Server components, uninstalling and reinstalling the Vault Server could resolve the problem.

  1. Begin by opening a Run dialog box using Windows key + R.
  2. Type in ‘appwiz.cpl’ and press Enter to open the Programs and Features menu.
    Open up the Programs and Features menu
  3. Find the entry for Vault Basic, Vault Workgroup, or Vault Professional (Server) and right-click on it, selecting Uninstall from the drop-down menu.
    Uninstall the Autodesk Vault Professional Server
  4. On the new screen that appears, click on Uninstall, then follow the on-screen instructions to complete the process.
    Uninstalling the Autodesk Vault server installation
  5. Once complete, go to Autodesk Vault’s installation directory and remove any residual files.
  6. Reboot your machine and reinstall the server software from the provided media or through a fresh download.

12. Prevent antivirus interference (if applicable)

If you still haven’t found a solution, realize that aggressive security software can sometimes interfere with legitimate programs such as AutoDesk Vault.

You may need to disable real-time protection or, in some cases, uninstall the entire antivirus suite to stop it from impacting Vault’s functions. Security suites, particularly those from Comodo, Avast, and McAfee, can be too aggressive and may need to be controlled to resolve this issue.

To disable real-time protection or uninstall a problematic security suite (and clean leftover files), follow these generic steps:

  1. Open the Run dialog box with Windows key + R, type ‘appwiz.cpl’ and hit Enter to display the Programs and Features menu.
  2. Find the installation of your antivirus program, right-click, and select Uninstall. Follow the on-screen instructions through completion.
  3. Restart your computer and ensure no remaining AV files are left that might cause the same issue by following this comprehensive uninstallation guide.
  4. Verify if the “Object reference not set to an instance of an object” error no longer occurs.
ABOUT THE AUTHOR

Muhammad Zubyan


Muhammad Zubyan is a certified Google IT Support Professional with over 7 years of extensive experience. He has worked on more than 1500 computers, gaining valuable insights that enable him to detect and troubleshoot any complicated root cause of Windows-related issues and errors. In addition to managing Appuals as a Senior Editor, he is currently developing his own Game Optimization program that caters to both gamers and casual users alike.