We help IT Professionals succeed at work.
Get Started

msbuild can't clean project with C# COM component dependant on other .NET library

Last Modified: 2013-12-17
I've got project A that depends on project C.  Project A is set up to be a COM object as well as a managed library.  Project B is a mixed C++ / Managed C++ library that bridges between our managed and unmanaged code.

Here's the error I get:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(854,9): error MSB3395: Cannot unregister assembly "F:\DOM\dev\DOM\R9_0\SRC\Execs\SvrCtl.dll". Could not load file or assembly 'M32UTIL, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

SvrCtl.dll is the COM one.  M32UTIL is the C++ library one.

The problem seems to be that M32Util gets cleaned first off, and then when msbuild goes to clean SvrCtl.dll then it causes a library loading error.
Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE