views:

87

answers:

1

I have VS2008 SP1 running with .NET 3.5 SP1

I have MVC2 running (with MVC1 uninstalled)

All works ok except when I call the System.Components.DatAnnotations.dll, then the compiler complains of not being able to find it.

Message is:

Could not load file or assembly 'System.ComponentModel.DataAnnotations, Version=99.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I tried repairing and reinstalling SP1 of both VS and .Net framework. I also tried referencing the assembly by browsing to it in the Reference assemblies in Programs directory.

I have tried out most of the Google search result forum results but to no avail, I think it may be something simple which I have over looked.

Any ideas?

A: 

You should open your .csproj file in notepad and correct reference path there

Sly
I can't see the reference path there t be able to correct it, what should it look like?
Paul Connolly
<Reference Include="System.ComponentModel.DataAnnotations"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference>you can specify exact path and version here
Sly
Sly, you put me onto the right track.It was not the reference path I needed but to change the "Copy Local" property of the dll to "True" (which is something like <Private>True</Private> in the same place in the .csproj file as you said to put the reference path). Thanks for the help
Paul Connolly