3

I have an F# project in Visual Studio 2012 and I'm trying to reference a specific version of certain assemblies. However, whenever I compile and run the application, the references change to a newer version.

I can remove all references then add them back like this: Before build

Then after I compile and run it once, if I go back to the reference manager, I see this: After build

What's happening here and is there any way to prevent it?

p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
  • I'm not sure what's going on however you can try manually editing the project file. In the solution explorer right click on a project and selected unload. Then right click again and select edit. Then edit it and click reload. – gradbot Jan 30 '14 at 00:16
  • If you select the reference under the "References" tab in the solution explorer and go to properties dialog, there should be an option "Specific version". Not sure if that helps, but you can try switching that to True, unless that is already selected... – Tomas Petricek Jan 30 '14 at 04:41

1 Answers1

2

I have seen this once with Office references in VS2012.

I think for some reason the change is not persisted back to the project file. And the compiler uses the file, which is reloaded when you check the references

The answer was to right click -> unload the project, then right-click again and edit the project file. By manual inspection, make sure the references are OK. Then just save the file and you should be good to go.

This bug in VS has been corrected now

nicolas
  • 9,549
  • 3
  • 39
  • 83
  • Yes, this seems to be the issue, it seems the referenced version in the fsproj file was 11.0.0.0 even after I removed them and added them back as 10.0.0.0. Changing it manually seems to have resolved the issue. – p.s.w.g Jan 30 '14 at 16:09