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: build error

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 -

  • Email a link to a friend (Opens in new window) Email
  • Tweet
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Reddit (Opens in new window) Reddit
  • Share on Telegram (Opens in new window) Telegram
  • Share on Tumblr
  • Print (Opens in new window) Print
  • Share on Mastodon (Opens in new window) Mastodon
  • Pocket
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
  • Post
  • 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,434,928 hits

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

Join 6,459 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

  • Fixed: Audit History Page Not Loading (Dataverse / Dynamics 365) January 22, 2026
  • Why We Switched Our Plugin from PreOperation to PreValidation – Dataverse / Dynamics 365 January 21, 2026
  • Using the Restore Message to Recover Deleted Records in Dataverse January 20, 2026
  • Advancing and Finishing a BPF Using RetrieveProcessInstancesRequest and RetrieveActivePathRequest (Dataverse / Dynamics 365) January 14, 2026
  • Finishing (Deactivating) and Reopening a Business Process Flow Using C# Console App (Dataverse / Dynamics 365) January 13, 2026
  • Advancing a Business Process Flow Stage Using a C# Console App (Dataverse / Dynamics 365) January 7, 2026
  • Using a Plugin to Generate Auto-Number Values for Legacy and Reopened Records in Dynamics 365 / Dataverse January 6, 2026
  • 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

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 989 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