Error when adding a reference to the main project in a solution

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

I get this error when I add a new Windows Service project and then add a reference to the main project "PerfWS". I can not figure out why this is happening?

[288 byte] By [perf101] at [2007-12-22]
# 1

Lets try to get some more info to track this issue down.

  1. What version of Visual Studio are you running? (2005, 2003 or 2002)
  2. If you try building first and then adding the reference does that work?
  3. Is PerfWS a VB Library project?
JaredParsonsMSFT at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 2

1. VB2005

2. It builds fine without the reference. As soon as I add the reference it fails.

3. PerfWS is a regular Windows Application project. I have the code setup in a way where the main form calls it to execute background processes (threads). I now want to add a Windows Service project to setup a service to run the code, and as soon as I add the reference and try to build it gives that error.

perf101 at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 3

I've tried a bunch of combinations out myself and I can't reproduce this error on my box. So most likely it's a set of conflicting settings in your solution. Have you messed with any of project settings (specifically) build in any of the projects?

Also, until I tried out your solution I didn't realize VS.Net supported references to EXEs :). It's perfectly valid but just in case VS is upset about it try converting your PerfWS project to a library and rebuilding. If it works it will at least narrow down the issue.

JaredParsonsMSFT at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 4

I tried everything and it still does not work.

What options do I have to make this thing work properly? Is there someone else I can contact that is able to help me with this in more detail?

Thanks,

perf101 at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 5

At this point I'm thinking it's either something conflicting in your project file for the main project or solution file. If you feel comfortable doing so, can you post the contents of your solution file and main project file?

JaredParsonsMSFT at 2007-8-30 > top of Msdn Tech,Visual Basic,Visual Basic IDE...