Could not find file 'Microsoft.Windows.CommonLanguageRuntime

Topics: DocSites, General Discussion, General Questions, Help 1.x/2.x, Sandcastle
Jul 22, 2008 at 4:28 AM
I have an existing VS2005 solution. In it contains
1 Web service
1 Console EXE

I right clicked on the solution and added a new DocProject project. Everything generated just fine. however, when i try to build the solution, i get the following error

Could not find file 'Microsoft.Windows.CommonLanguageRuntime, Version=2.0.50727.0'

Anyone have any idea as to why?  Also, i've searched for this error, I don't believe that the DocProject is referencing things as projects,  They are referenced in as DLLs and EXEs.

Also something else I noticed is that when I removed the references to my exsting projects in my DocProjects project, I then tried to reference them back in, when doing so, things compile just fine, however, the DocProject generates a warning saying that it has no references.

Thanks for any help!
Jul 22, 2008 at 5:33 AM

There's a limitation in VS 2005 that will cause builds to fail if one project references another that is configured to use Click Once deployment.  Either disable Click Once on the source project or add a reference to it using the External sources dialog instead of as a project reference.  (The External sources dialog is available in the DocProject Properties window under the Build category.)

I'm not sure what's going on with your second problem.  It could be a bug.  I'll test it out and get back to you.

- Dave
Jul 22, 2008 at 6:42 AM

I couldn't reproduce your second issue.  Here's what I tried: 

  1. Started VS 2005.
  2. Added a new WinForms project to an existing test solution and published it using Click Once.
  3. Added a new DocSite project to the same solution
  4. In the last step of the New Project Wizard, selected the Click Once app as a source project reference.  Clicked Finish on the New Project Wizard.
  5. When the DocSite was finally ready in VS, added a project reference to an existing Class Library project in the same solution (not Click Once).
  6. Built the solution and got your first error (due to the Click Once issue in VS 2005)
  7. Removed both project references from the DocSite.
  8. Added a project reference to the existing Class Library project again.  (Though I did not add the Click Once project back again this time.)
  9. Built the solution and it produced documentation for the Class Library project.
This is the expected behavior.  If you are getting different results, what can I do to reproduce the issue?  Am I missing any steps?

- Dave
Jul 22, 2008 at 3:26 PM
Hi Dave

My solution does not contain any click once references.  Is there something I can be looking for?  What I did do though is to remove my web service and the console executable references.  Even though neither of those use click once the project compiled without error.

Jul 22, 2008 at 4:00 PM

I think that if you've ever played around with the stuff on the Publish tab it puts something into the project that makes it Click Once-ready.   Open up the project files and try removing anything related to publishing or Click Once.  If that doesn't work please let me know.

- Dave