You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a previous release a similar error could be overcome by being careful about how you reference FSharp.Core st you make sure the optdata & sigdata files are also present. This is now not having an effect on the problem.
Error
[|unknown (1,1)-(1,81) parse error Could not load file or assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.|]
This is actually the same root error that has arisen in a downstream project (QuotationCompiler) and has me testing where the root of the problem lies.
Configuration
Visual Studio 2015
F# 4.0 (I could use F# 3.1 if need be for the interim)
Resolution
The following seems to be the only relevant item on the subject: #337
But I am not 100% sure.
Following some threads on issues on this github repo I can see that the dependency on Microsoft.Build.Framework seems to be an issue.
I have added FSharp.Compiler.Tools to my test project (via nuget). I can see that this adds a dll into packages for 'Microsoft.Build.Framework' and that this in the "12.0" range. Unfortunately adding this as a reference in the project does not change the error given.
The error is complaining when looking for a version 12.0.0.0 and the actual version in FSharp.Compiler.Tools is 12.0.40629.0 so I have then tried a binding redirect on app.config as follows:
ASIDE ONE I looked through the dependencies of FSharp.Compiler.Services from the paket file on github and could find no mention of the MSBUILD dependencies. I was just trying to trace the precise version of Microsoft.Build.Framework.dll that I would need. Why?
ASIDE TWO it seems that my machine does not have the version 12.0.x.x of the Microsoft.Build series on the machine. I would imagine that this is because I have VS2015 loaded and have never had VS2013 installed. The thing is, if FSCS is now directed at F# 4.0 (which is kinda equivalent to VS2015) then why have the current version 1.4.x.x+ depend on those outdated assemblies. Just asking to test my own understanding of this dependency soup.
The dependency is there for the project cracking facility. I think we have agreed that the best approach here is to move this out of process, and this other assembly would then take the dependency and handle loading the best MSBuild version available. I have done this for FsAutoComplete, but haven't had time to port it over. In the meantime, have you tried instead redirecting to the 14.0.0.0 version you have installed with VS2015?
[|unknown (1,1)-(1,81) parse error Could not load file or assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.|]
It appears "hard-wired" to look for a particular version and no other?! Unfortunately, FSCS is unusable for me at present.
Submit a PR to FCS to remove the hard-wired v12 dependency by moving the project cracking out of process. This would then use a method similar to (2) in a separate console application. I can help review and test such a PR.
@rneatherway I tried to adjust app.config to not use the build numbers but it didn't work. Then tried copying your code in (2) above and calling it prior to the compile step... SUCCESS!! Thanks.
Activity
cognociente commentedon Sep 25, 2015
Following some threads on issues on this github repo I can see that the dependency on Microsoft.Build.Framework seems to be an issue.
I have added FSharp.Compiler.Tools to my test project (via nuget). I can see that this adds a dll into packages for 'Microsoft.Build.Framework' and that this in the "12.0" range. Unfortunately adding this as a reference in the project does not change the error given.
The error is complaining when looking for a version 12.0.0.0 and the actual version in FSharp.Compiler.Tools is 12.0.40629.0 so I have then tried a binding redirect on app.config as follows:
I really thought this would work...but it didn't!
Please help.
ASIDE ONE I looked through the dependencies of FSharp.Compiler.Services from the paket file on github and could find no mention of the MSBUILD dependencies. I was just trying to trace the precise version of Microsoft.Build.Framework.dll that I would need. Why?
ASIDE TWO it seems that my machine does not have the version 12.0.x.x of the Microsoft.Build series on the machine. I would imagine that this is because I have VS2015 loaded and have never had VS2013 installed. The thing is, if FSCS is now directed at F# 4.0 (which is kinda equivalent to VS2015) then why have the current version 1.4.x.x+ depend on those outdated assemblies. Just asking to test my own understanding of this dependency soup.
rneatherway commentedon Sep 28, 2015
The dependency is there for the project cracking facility. I think we have agreed that the best approach here is to move this out of process, and this other assembly would then take the dependency and handle loading the best MSBuild version available. I have done this for FsAutoComplete, but haven't had time to port it over. In the meantime, have you tried instead redirecting to the 14.0.0.0 version you have installed with VS2015?
cognociente commentedon Sep 30, 2015
Was pretty sure that was one of the permutations I tried but I tried it again anyway.
(0) FSCS latest version from Nuget
(1) I referenced version 14.0.23107.0 located at "C:\Program Files (x86)\Reference Assemblies\Microsoft\MSBuild\v14.0"
(2) I adjusted my app.config file as follows:
I still receive the following run-time error:
[|unknown (1,1)-(1,81) parse error Could not load file or assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.|]
It appears "hard-wired" to look for a particular version and no other?! Unfortunately, FSCS is unusable for me at present.
rneatherway commentedon Sep 30, 2015
@cognociente I have never used the build numbers in binding redirects, I would suggest just using:
If that still doesn't work, there are three other options:
cognociente commentedon Sep 30, 2015
@rneatherway I tried to adjust app.config to not use the build numbers but it didn't work. Then tried copying your code in (2) above and calling it prior to the compile step... SUCCESS!! Thanks.
rneatherway commentedon Sep 30, 2015
I'm glad it works now, but it isn't a long-term solution. I'll see if I can find time for that PR.