Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Visual Studio / Visual Studio .NET 2003 C# Compile Error CS0042

Visual Studio .NET 2003 C# Compile Error CS0042

July 13, 2005 by Rob Bazinet

Tweet

I am working on a VS.NET 2003 C# web project that contains multiple projects and on occasion I get an annoying fatal build error (CS0042):

Unexpected error creating debug information file ‘<project path>\obj\Debug\<DLL Name>.PDB’: The process cannot access the file because it is being used by another process.

Starting with a Google search led me to many developers having the same or similar problems with the following advice:

  1. Exit VS.NET, restart VS.NET and reopen project
  2. Change project from Debug Build to Release Build and visa-versa.
  3. Remove all Enums from classes and just use in the namespace
  4. Ensure all DLL projects have  ‘CopyLocal’ set to true AND references to these DLL’s be a Project Reference and not simple a DLL reference.

I followed all of the guidance of the experiences I saw in my Google search with #1 working every time.  The only problem with this solution was exiting and restarting VS.NET all the time.  In case you haven’t had the pleasure, it takes a long time to load.  Although this worked, it didn’t seem the greatest solution to me and was a poor way to fix a deeper problem.

Further sluething using Process Explorer from Sysinternals revealed Devenv.exe was holding my PDB file open.  A post to the MSDN .NET General Newsgroup let to some further clues.

As I pointed out, I am not the only one having this problem, and it seems Microsoft is well aware of these issues.  KnowledgeBase articles 313512 and 887818 show occurances of the bug and a hotfix that is available by request-only.  I don’t think this is the right approach to such an annoying problem and either does Frans Bouma who has a great post on his blog about this very problem and the lack of service pack for VS.NET 2003.

I called Microsoft to request this hotfix and the person I spoke with fromt he VS.NET 2003 C# Support Team told me I was the third person requesting this hotfix THIS MORNING.  So, why don’t we see a service pack before now? We have seen multiple hotfixes for Windows XP already and VS.NET 2003 has been in use just as long.  If I recall correctly we had six service packs for Visual Studio 6.

I have installed the hotfix and all seems to be working well with no problems reported.  I hope this helps others out there.

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Related

Filed Under: Visual Studio

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Comments

  1. Nikola says

    August 9, 2006 at 9:28 am

    Thank you for your help. I have recently started to work in some softver company. I am

    totaly inexperience and error CS0042 has emerge from depths of hell to ruin my career at

    the beginning. Thank you again, and thank you in advance for solving another errors from

    HELL!!!

    By

  2. Nikola says

    August 9, 2006 at 9:28 am

    Thank you for your help. I have recently started to work in some softver company. I am
    totaly inexperience and error CS0042 has emerge from depths of hell to ruin my career at
    the beginning. Thank you again, and thank you in advance for solving another errors from
    HELL!!!
    By

  3. Rob Bazinet says

    August 9, 2006 at 2:59 pm

    Your very welcome. I am glad I could help. The idea behind my blog is to share experience, which is how so many problems are solved.

  4. Rob Bazinet says

    August 9, 2006 at 2:59 pm

    Your very welcome. I am glad I could help. The idea behind my blog is to share experience, which is how so many problems are solved.

Recent Posts

  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur
  • RailsConf 2021 and the Future of Conferences
  • Fixing Out of Diskspace Errors on Amazon EC2

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet
@rbazinet

  • Exactly this…. https://t.co/yWj7fZ01HR
    about 17 hours ago
  • https://t.co/EmagdpLoNv "Introducing GitHub Copilot X · GitHub"
    about 1 day ago
  • RIP Gordon Moore: https://t.co/c5J9LaHrj8
    about 1 day ago
  • Our daughter works as a teaching assistant at a local K-8 public school. It’s become apparent that students today r… https://t.co/p2t912GVyc
    about 2 days ago
  • Working to wrap up my current consulting gig by mid-April. I will be looking for the next thing soon. If anyone has… https://t.co/sg3cSV9yqM
    about 3 days ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon