web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Could not write state file (creating VS project)

(7) ShareShare
ReportReport
Posted on by 1,993
Hi,

I've been seeing this warning lately when creating new projects
 Could not write state file "obj\Debug\XX.rnrproj.AssemblyReference.cache". Could not find a part of the path 'C:\Users\YY\Documents\Visual Studio 2022\Projects\XX\XX\obj\Debug\XX.rnrproj.AssemblyReference.cache'.   

Categories:
I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,417 Super User 2026 Season 1 on at

    Hi there 👋

    Thanks for your question!

    The error you're encountering—"Could not write state file... Could not find a part of the path..."—typically occurs when Visual Studio is unable to locate or access the required directories during project creation or build.

    ✅ Here are a few steps to resolve this:

    1. Check folder paths and permissions

      • Make sure the full path exists:
        C:\Users\[YourUser]\Documents\Visual Studio 2022\Projects\[ProjectName]\obj\Debug\
      • If any folder in the path is missing, create it manually.
    2. Correct path formatting

      • The error suggests that some paths are missing backslashes (\). This could be due to a misconfigured project or corrupted settings. Try recreating the project in a clean directory.
    3. Run Visual Studio as Administrator

      • Right-click on Visual Studio and select Run as administrator to ensure it has permission to write to the required folders.
    4. Clear temporary build files

      • Delete the obj and bin folders from your project directory and rebuild the solution.
    5. Check for antivirus or security software interference

      • Sometimes, security software can block file creation. Temporarily disable it to test.

    Hope this helps!
    ✅ Please mark this reply as helpful if it answered your question.
    Best regards! 👋

  • Suggested answer
    Cyrille Nembot Profile Picture
    149 on at

    This warning typically occurs when
    Visual Studio is unable to create or access files in your project's
    output directory (usually the obj\Debug folder). Here are some possible causes and solutions:

    Common Causes:

    1. Missing folders in the path: The obj\Debug directory might not exist.

    2. Permission issues: Your user account might not have write permissions to the folder.

    3. File locking: Another process might be locking the file.

    4. Anti-virus interference: Your anti-virus might be blocking file creation.

    5. Path length limitations: The full path might exceed Windows' maximum path length.

    Solutions:

    1. Clean and rebuild the solution:

      • In Visual Studio: Build → Clean Solution, then Build → Rebuild Solution

    2. Manually create the missing folders:

      • Navigate to your project directory (C:\Users\YY\Documents\Visual Studio 2022\Projects\XX\XX\)

      • Create the missing folders (obj\Debug) if they don't exist

    3. Check folder permissions:

      • Right-click on your project folder → Properties → Security

      • Ensure your user account has full control

    4. Run Visual Studio as administrator:

      • Right-click Visual Studio → Run as administrator

    5. Disable anti-virus temporarily:

      • Try disabling your anti-virus to see if it's interfering

    6. Check for path length issues:

      • If the path is very long, try moving your project to a shorter path (like C:\Projects\)

    7. Delete the obj folder:

      • Close Visual Studio

      • Delete the entire obj folder in your project directory

      • Reopen Visual Studio and rebuild

    8. Check for file locks:

      • Use Process Explorer to check if another process is locking the file

    9. Repair Visual Studio installation:

      • Go to Control Panel → Programs → Visual Studio → Change → Repair

    If none of these work, you might want to:

    • Create a new project and migrate your code

    • Check the Windows Event Viewer for more detailed error messages

    • Update Visual Studio to the latest version

  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at
    Hi ..,
     
    You got two replies that most likely were generated by AI. Do you still have the issue, or have you resolved the problem already? 
    If you still have this issue, can you tell us what type of development environment you are using and if there were changes applied before it started to give errors?
  • Komi Siabi Profile Picture
    13,208 Most Valuable Professional on at
    Hi @DAnny3211 &  @Cyrille Nembo. Your answer looks like AI generated suggestion. Kindly always make reference to the AI tool used in providing feedback.
  • Sagar121 Profile Picture
    1,160 Super User 2026 Season 1 on at
    Hi, 
    I will try below initially.
    Can you please try to un-map and re-map Project Folder.
    Also, pls right click on solution explorer and try to un-load and reload the Project.
  • Bret Fraser Profile Picture
    Community Manager on at
    Thanks for posting @DAnny3211, we appreciate your desire to help the Community!
     
    I think your reply might be an AI-assisted post, but I do not see any tools or sources cited. Can you update the post to include your sources, or confirm this was not produced using AI?
     
    Please refer to the Use AI responsibly section of Writing effective responses in the community:
     
    Do not
    • Copy and paste AI-generated answers into the forum without verification. While AI is a valuable tool, it is not always correct, and can provide detailed answers that look correct, but are not.
    • Conceal the use of AI. If your answer was written in concert with AI, be forthright about it to ensure that others have an opportunity to review or vet your response for accuracy.
     
    Thank you!
     
    Bret
  • Bret Fraser Profile Picture
    Community Manager on at
    Thanks for posting @Cyrille Nembot, we appreciate your desire to help the Community!
     
    I think your reply might be an AI-assisted post, but I do not see any tools or sources cited. Can you update the post to include your sources, or confirm this was not produced using AI?
     
    Please refer to the Use AI responsibly section of Writing effective responses in the community:
     
    Do not
    • Copy and paste AI-generated answers into the forum without verification. While AI is a valuable tool, it is not always correct, and can provide detailed answers that look correct, but are not.
    • Conceal the use of AI. If your answer was written in concert with AI, be forthright about it to ensure that others have an opportunity to review or vet your response for accuracy.
     
    Thank you!
     
    Bret

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 658

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 468 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 333 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans