[F#][WPF] Компиляция из командной строки, references
От: Аноним  
Дата: 21.07.10 18:06
Оценка:
Привет всем, хочу скомпилировать некоторый файл, который требует добавления PresentationFramework, PresentationCore и пр. в "References".
Как в студии это сделать — знаю, а вот как это нормально сделать из командной строки(fsc.exe)?

Если делать так, то получаю ворнинги:
fsc -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationCore.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xaml.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll" test.fs

Microsoft (R) F# 2.0 Compiler build 2.0.0.0

Copyright (c) Microsoft Corporation. All Rights Reserved.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\PresentationCore.dll'. Consider recompili

ng the library or making an explicit reference to a version of this library that

 matches the CLI version you are using.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll'. Consider reco

mpiling the library or making an explicit reference to a version of this library

 that matches the CLI version you are using.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\System.Xaml.dll'. Consider recompiling th

e library or making an explicit reference to a version of this library that matc

hes the CLI version you are using.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'fsc -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationCore.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xaml.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" -r "C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll" test.fs

Microsoft (R) F# 2.0 Compiler build 2.0.0.0

Copyright (c) Microsoft Corporation. All Rights Reserved.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\PresentationCore.dll'. Consider recompili

ng the library or making an explicit reference to a version of this library that

 matches the CLI version you are using.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\PresentationFramework.dll'. Consider reco

mpiling the library or making an explicit reference to a version of this library

 that matches the CLI version you are using.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\System.Xaml.dll'. Consider recompiling th

e library or making an explicit reference to a version of this library that matc

hes the CLI version you are using.



warning FS0217: The referenced or default base CLI library 'mscorlib' is binary-

incompatible with the referenced library 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll'. Consider recompiling th

e library or making an explicit reference to a version of this library that matc

hes the CLI version you are using.

И запустить скомпиленый вариант не получится запустить.

Пробую добавить референс на 'C:\Program Files\Reference Assemblies\

Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll' c опцией --noframework.

Вообще не собирается:
unknown(1,1): error FS0219: The referenced or default base CLI library 'mscorlib
' is binary-incompatible with the referenced F# core library 'C:\Program Files\FSharp-2.0.0.0\bin\FSharp.Core.dll'. Consider recompiling the
library or making an explicit reference to a version of this library that matche
s the CLI version you are using.

unknown(1,1): error FS0229: Error opening binary file 'C:\program files\FSharp-2.0.0.0\bin\FSharp.Core.dll': Exception of type 'Microsoft.FSh
arp.Compiler.ErrorLogger+ReportedError' was thrown.


Подскажите что делать, пожалуйста. Сильно не пинайте, с дотнетом не сильно знаком
f#
Re: [F#][WPF] Компиляция из командной строки, references
От: Пельмешко Россия blog
Дата: 21.07.10 19:28
Оценка:
Здравствуйте, Аноним, Вы писали:

А>Подскажите что делать, пожалуйста. Сильно не пинайте, с дотнетом не сильно знаком


Можно посмотреть окошко Output -> Build в студии и обнаружить что-то типа:
C:\Program Files\Microsoft F#\v4.0\fsc.exe
  -o:obj\x86\Debug\ConsoleApplication4.exe
  -g
  --debug:full
  --noframework
  --define:DEBUG
  --define:TRACE
  --doc:bin\Debug\ConsoleApplication4.XML
  --optimize-
  --tailcalls-
  --platform:x86
  -r:"C:\Program Files\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\FSharp.Core.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\PresentationCore.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\PresentationFramework.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Numerics.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xaml.dll"
  -r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\WindowsBase.dll"
  --target:exe
  --warn:3
  --warnaserror:76
  --vserrors
  --LCID:1033
  --utf8output
  --fullpaths
  Program.fs

Похоже в Вашем случае ошибка в том, что подключается сборка FSharp.Core.dll для .NET Framework версии 2.0, а не 4.0.

p.s. --noframework и подключение mscorlib для компиляции под 4.0 нужны, это Вы верно сообразили.
Re[2]: [F#][WPF] Компиляция из командной строки, references
От: Аноним  
Дата: 22.07.10 01:02
Оценка:
Здравствуйте, Пельмешко, Вы писали:

П>Похоже в Вашем случае ошибка в том, что подключается сборка FSharp.Core.dll для .NET Framework версии 2.0, а не 4.0.


А ведь точно! Спасибо большое, только не понятно почему у меня 4.0 нету, я вроде-бы последнюю версию качал с fsharp.net
Re[3]: [F#][WPF] Компиляция из командной строки, references
От: Аноним  
Дата: 22.07.10 01:09
Оценка:
Проблема решилась путем скачивания инсталятора и переустанавливанием рантайма. Юзабилити, е#%&!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.