Skip to content

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

  • Admin Center URL(s)
  • Sample Code – Dynamics 365 Web API
  • 2021 Release Wave 1 – Dynamics 365
    • 2020 Release Wave 1
    • 2020 Release Wave 2
    • 2019 Release Wave 2
  • Azure
  • Azure Data Lake
  • Azure Functions
  • Power Automate – Approvals
  • PowerApp Portals
  • Omnichannel for Customer Service
  • Power Platform Dataflows
  • Power BI
  • SSIS / KingswaySoft
  • OAuth 2.0
  • Dynamics 365 Mobile App
  • Microsoft Bot Framework
  • Microsoft Dynamics 365
  • Microsoft Dynamics 365 Developer Training
  • Code snippets
  • SoundCloud – My Tunes
  • Books Reviewed
  • Order My Book (Dynamics 365 Application Development)
  • About me
Nishant Rana's Weblog

Tag: Metadata File Not Found

Solving CS0006: Metadata File Not Found Error in Visual Studio

Solving CS0006: Metadata File Not Found Error in Visual Studio

Recently, we encountered a build error in one of our Dynamics 365 projects where Visual Studio was unable to find metadata files for NuGet packages, even though the packages were installed.

CSC : error CS0006: Metadata file ‘C:\Users\NishantRana\source\repos\Compass Optimisation\ABC.Xrm.Solution\packages\ABC.Extensions.1.0.3\lib\netstandard2.0\ABC.Extensions.dll’ could not be found

On checking the packages folder, we could see that all our the ABC.Extensions / ABC.Xrm.Common DLLs were present in their respective directories. However, the build was still failing with the CS0006 error.

What was tried first – A typical CS0006 checklist includes:

Clean + Rebuild the entire solution.​

Delete bin and obj folders and rebuild.​

Restore NuGet packages

Verify the project references and hint paths in the .csproj file.​

All of the above were tried, but the CS0006 errors persisted for the assemblies , even though other package references worked fine.

After some investigation, we noticed something interesting in the error message – the repository path contained a space: “Compass Optimisation“

Some tools, build scripts, or older MSBuild / custom targets can still be sensitive to spaces in paths, especially if any custom build logic concatenates paths without proper quoting. In this case, the the assemblies were referenced from packages, but the effective build path that MSBuild/targets resolved appeared to break because of the space in the parent folder name.

To confirm this, a new Git repo and solution were created in a folder without spaces:

C:\Users\NishantRana\source\repos\CompassOptimisation\ABC.Xrm.Solution\…

After moving the solution and re‑cloning into CompassOptimisation (no space), restoring packages, and rebuilding, the CS0006 errors disappeared and the project built successfully.

So the issue was caused by the space in the repository folder name. While modern development tools generally handle spaces in paths, some parts of the MSBuild or NuGet resolution process still struggle with them, causing the compiler to incorrectly parse the file paths.

The solution here is to avoid using spaces in your repository or project folder names. Use naming conventions like PascalCase (CompassOptimisation), kebab-case (compass-optimisation), or snake_case (compass_optimisation) instead.

Hope it helps..

Advertisements

Share It -

  • Click to email a link to a friend (Opens in new window) Email
  • Tweet
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on Telegram (Opens in new window) Telegram
  • Share on Tumblr
  • Click to print (Opens in new window) Print
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Pocket
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
  • Post
  • Click to share on Bluesky (Opens in new window) Bluesky
Like Loading...
Unknown's avatarAuthor Nishant RanaPosted on January 1, 2026December 1, 2025Categories Microsoft Dynamics 365, Visual StudioTags build error, Metadata File Not Found, visual studio1 Comment on Solving CS0006: Metadata File Not Found Error in Visual Studio
Advertisements

Blog Stats

  • 6,419,538 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 6,454 other subscribers
Advertisements

KingswaySoft MVP

Archives

Readers

Map
Advertisements
Advertisements

Follow me on Twitter

My Tweets

jooble

jooble
Advertisements
Microsoft Community Contributor

Top 100 CRM Blogs and Websites

Get more details ..

Advertisements

Recent Posts

  • Solving CS0006: Metadata File Not Found Error in Visual Studio January 1, 2026
  • [Tool Showcase – PowerMakerAI] Talk to Your CRM Like a Teammate — Meet PowerMakerAI’s Context-Aware Chatbot December 30, 2025
  • Action ‘Update_a_record’ failed: An error has occurred. No resources were found when selecting for update – Fixing Cross-Company Update Issues in Finance & Operations Using Dataverse Virtual Entities (Power Automate) December 2, 2025
  • Fixing the “Only 1 of 2 keys provided for lookup, provide keys for dataAreaId, ProjectID / Not found” Error in Power Automate (Fin & Ops Apps) November 25, 2025
  • Fixed – Error occurred while loading document template / Error occurred while loading preview error in Dynamics 365 November 18, 2025
  • How to Identify and Update Power Automate HTTP Request Trigger Flows Before November 2025 November 12, 2025
  • Using Parent Context in Dynamics 365 Plugins — Detecting System-Triggered Operations (Dataverse / Dynamics 365) November 11, 2025
  • Fixed – “Action cannot be performed. This quote is not owned by Dynamics 365 Sales” in Dataverse / Dynamics 365 November 5, 2025
  • Understanding “Block Deletion of Out-of-the-box Attribute Maps” in Dataverse / Dynamics 365 November 4, 2025
  • Flows getting triggered multiple times / missing callbackregistration record – Power Automate / Dataverse October 23, 2025

My Badges – Dynamics 365 Community

Advertisements
Advertisements
Follow Nishant Rana's Weblog on WordPress.com
Log in
  • Admin Center URL(s)
  • Sample Code – Dynamics 365 Web API
  • 2021 Release Wave 1 – Dynamics 365
    • 2020 Release Wave 1
    • 2020 Release Wave 2
    • 2019 Release Wave 2
  • Azure
  • Azure Data Lake
  • Azure Functions
  • Power Automate – Approvals
  • PowerApp Portals
  • Omnichannel for Customer Service
  • Power Platform Dataflows
  • Power BI
  • SSIS / KingswaySoft
  • OAuth 2.0
  • Dynamics 365 Mobile App
  • Microsoft Bot Framework
  • Microsoft Dynamics 365
  • Microsoft Dynamics 365 Developer Training
  • Code snippets
  • SoundCloud – My Tunes
  • Books Reviewed
  • Order My Book (Dynamics 365 Application Development)
  • About me
Nishant Rana's Weblog Website Powered by WordPress.com.
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Nishant Rana's Weblog
    • Join 984 other subscribers
    • Already have a WordPress.com account? Log in now.
    • Nishant Rana's Weblog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
%d