Unable to build or run sample projects.

299 views
Skip to first unread message

Shane Delmore

unread,
Jul 18, 2012, 8:19:47 PM7/18/12
to fsh...@googlegroups.com
I have spent a few hours trying to get any sample fsharpx project to build and am having no luck.  I don't really know what I am doing which is why I am hoping to look at samples but even that is beyond me at the moment.

I have searched for hours trying to find a walk through that I can use but just keep hitting dead ends.  Here is what I have done, if anyone can point out anything obvious I am doing wrong I would appreciate it.

Downloaded Visual Studio Ultimate RC yesterday.
Downloaded FsharpX complete source with samples today.
Opened samples/WPF/WPFSample/WPFSample.sln.
Pressed build. 
Failed at type XAML is not defined.
Tried installing the nuget package for fsharpx (I don't actually know how to use nuget packages).
Still failed.

I have tried a bunch of other paths as well, all failing.  This is all a bit new to me, I have at various times over the years grabbed sample projects to play around with and I just open them and build them, easy as can be but after trying it with six different F# packages I am wondering if my environment is incorrect or if there is some initial setup that is being assumed away I am missing.

-Shane

Shane Delmore

unread,
Jul 18, 2012, 8:59:17 PM7/18/12
to fsh...@googlegroups.com
Still rough going but I figured I would post my attempts to get things working until someone reads this or I get it working.

I noticed in WPFSample that wouldn't build the reference to FSharpx.TypeProviders has an exclamation mark next to it.  To attempt to get it working I opened the package manager console and ran 

Install-Package FSharpx.TypeProviders
which resulted in

Successfully installed 'FSharpx.TypeProviders 1.6.4'.
Successfully uninstalled 'FSharpx.TypeProviders 1.6.4'.
Install failed. Rolling back...
Install-Package : Failed to add reference to 'Fsharpx.Core'.
At line:1 char:16
+ Install-Package <<<<  FSharpx.TypeProviders
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
 

So that didn't help.

-Shane

Shane Delmore

unread,
Jul 18, 2012, 9:33:17 PM7/18/12
to fsh...@googlegroups.com
Just to keep this updated on my attempts I tried running buildall.bat and ended up mostly green but with the following errors.

WARNING: 2 issue(s) found with package 'FSharpx.TypeProviders'.

Issue: Incompatible files in lib folder.
Description: The file 'lib\35\_._' is not a valid assembly. If it is an XML documentation file or a .pdb file, there is no matching assembly specified in the same folder.
Solution: Either remove this file from 'lib' folder or add a matching .dll for it.

Issue: Incompatible files in lib folder.
Description: The file 'lib\40\_._' is not a valid assembly. If it is an XML documentation file or a .pdb file, there is no matching assembly specified in the same folder.
Solution: Either remove this file from 'lib' folder or add a matching .dll for it.

I did a search in windows for lib\40 but it came back with nothing.  I don't actually see a file named _._ anywhere to remove but maybe this is a bogus error message?
Message has been deleted

Shane Delmore

unread,
Jul 18, 2012, 10:41:02 PM7/18/12
to fsh...@googlegroups.com
 I tried reinstalling .net 4.5 and silverlight.  Maybe it helped?
build.v4.5.bat works. with no errors, 3.5 and 4 still give the same error as before.

Should I be trying to get this working in VS2010 instead of 2012?  Is there any documentation on which versions of silverlight and .net should I use?


Shane Delmore

unread,
Jul 18, 2012, 10:46:49 PM7/18/12
to fsh...@googlegroups.com
Answering my own question here to keep the thread up to date.  The WPFSample project targets Visual Studio 2012.

No luck building it though, it results in

C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\samples\WPF\WPFSample\Program.fs(4,6): error FS0039: The namespace or module 'FSharpx' is not defined
C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\samples\WPF\WPFSample\Program.fs(6,19): error FS0039: The type 'XAML' is not defined
C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\samples\WPF\WPFSample\Program.fs(6,19): error FS0039: The type 'XAML' is not defined
C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\samples\WPF\WPFSample\Program.fs(10,12): error FS0039: The field, constructor or member 'Button1' is not defined
C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\samples\WPF\WPFSample\Program.fs(13,12): error FS0039: The field, constructor or member 'MainWindow' is not defined


Mauricio Scheffer

unread,
Jul 18, 2012, 11:21:17 PM7/18/12
to fsh...@googlegroups.com
Hi Shane,

You need VS2012 to work with type providers.
Here's how to open the WPF sample:
Run msbuild FSharpx.WithTypeProviders.sln
Open samples\WPF\WPFSample\WPFSample.fsproj in VS2012.
Compile and run the project with F5.

Cheers,
Mauricio

Ryan Riley

unread,
Jul 18, 2012, 11:49:31 PM7/18/12
to Mauricio Scheffer, fsh...@googlegroups.com
Ah, that's right. You have to compile the type provider project apart from the project consuming the type provider. Is that in the F# 3.0 docs?

Sent from my Windows Phone

From: Mauricio Scheffer
Sent: 7/18/2012 10:21 PM
To: fsh...@googlegroups.com
Subject: Re: [fsharpx] Re: Unable to build or run sample projects.

Shane Delmore

unread,
Jul 19, 2012, 12:56:29 AM7/19/12
to fsh...@googlegroups.com
I tried running msbuild but the build fails.  It complains about my configuration and something referencing HPD but I am not sure what it means.

C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1>msbuild FSharpx.Wit
hTypeProviders.sln
Microsoft (R) Build Engine version 4.0.30319.17626
[Microsoft .NET Framework, version 4.0.30319.17626]
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 7/18/2012 9:51:45 PM.
Project "C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\FSharpx.W
ithTypeProviders.sln" on node 1 (default targets).
C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-5807fc1\FSharpx.WithTypePr
oviders.sln.metaproj : error MSB4126: The specified solution configuration "Deb
ug|HPD" is invalid. Please specify a valid solution configuration using the Con
figuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configurat
ion=Debug /p:Platform="Any CPU") or leave those properties blank to use the def
ault solution configuration. [C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsha
rpx-5807fc1\FSharpx.WithTypeProviders.sln]
Done Building Project "C:\temp\fsharp-fsharpx-1.6.4.0 vs2010\fsharp-fsharpx-580
7fc1\FSharpx.WithTypeProviders.sln" (default targets) -- FAILED.
 

Shane Delmore

unread,
Jul 19, 2012, 1:23:06 AM7/19/12
to fsh...@googlegroups.com
No luck.  I got further adding the /p:Platform="Any CPU" switch on but then it complains about needing the .net 4.0 targeting pack.  I can't quickly figure out how to get the .net 4 targeting pack (I have .net 4.5 which I read uninstalls and supercedes .net 4.0).

I am going to try setting up a fresh windows install tomorrow to see if I can build this.

-Shane

Mauricio Scheffer

unread,
Jul 19, 2012, 10:36:43 AM7/19/12
to fsh...@googlegroups.com
I can't find anything that says "HPD" in the whole FSharpx repository. So it seems to me that either you have local changes (in that case, revert those changes), or your .Net install is somehow screwed up (in this case, reinstall the SDK  http://www.microsoft.com/en-us/download/details.aspx?id=8279  and then VS2012 RC).

--
Mauricio

Shane Delmore

unread,
Jul 19, 2012, 2:42:21 PM7/19/12
to fsh...@googlegroups.com
I found an had an environment variable %platform% set to HPD.  I have no idea what that means but changing it to any cpu did not fix the issue.  I did not realize I needed the win7 sdk so that was another piece I was missing, I am now in the process of setting up a new virtual machine with win7 sdk along with Visual Studio 2012.  Unfortunately I already had Visual Studio 2012 installed before I read this message about installing the win7/.net4 sdk first so I may need to rebuild it one more time and install in the correct order.

Thanks for the help.

-Shane

Shane Delmore

unread,
Jul 19, 2012, 6:20:21 PM7/19/12
to fsh...@googlegroups.com
I just tried again although order of operations may have messed me up.

I had already installed VS2012, then I read the message to install the win7/.net 4 sdk which I did and it completed successfully.

Now when I try to run the msbuild task I get an error about not having silverlight 4, but when I try to install silverlight 4 sdk it says I already have a newer version of silverlight installed and I cannot install silverlight 4.

-Shane


"C:\Temp\fsharp-fsharpx-5807fc1\FSharpx.WithTypeProviders.sln" (default target)
 (1) ->
"C:\Temp\fsharp-fsharpx-5807fc1\src\FSharpx.Observable\FSharpx.Observable.Silve
rlight.fsproj" (default target) (9) ->
(GetFrameworkPaths target) ->
  C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlig
ht.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [C:\T
emp\fsharp-fsharpx-5807fc1\src\FSharpx.Observable\FSharpx.Observable.Silverligh
t.fsproj]

Shane Delmore

unread,
Jul 19, 2012, 6:48:02 PM7/19/12
to fsh...@googlegroups.com
I found an article stating the the reason silverlight 4 isn't found is that silverlight 4 is x86 only and that my computer is x64.  Is it possible that everyone who is able to build this is running x86?

Am I supposed to run msbuild in the x86 or x64 visual studio command prompt?

I tried both and had no success, my latest attempt was to open the x86 visual studio native tools command prompt and run:
CD C:\Temp\fsharp-fsharpx-5807fc1
msbuild FSharpx.WithTypeProviders.sln

After redownloading the project and freshly extracting it without any other changes.

I then failed with:

"C:\Temp\fsharp-fsharpx-5807fc1\Fsharpx.WithTypeProviders.sln" (default target)
 (1) ->
"C:\Temp\fsharp-fsharpx-5807fc1\samples\TimeFliesLikeAnArrow.Silverlight\TimeFl
iesLikeAnArrow.Silverlight.csproj" (default target) (12) ->
(ResolveAssemblyReferences target) ->
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1561,5
): warning MSB3245: Could not resolve this reference. Could not locate the asse
mbly "FSharp.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3
64e35, processorArchitecture=MSIL". Check to make sure the assembly exists on d
isk. If this reference is required by your code, you may get compilation errors
. [C:\Temp\fsharp-fsharpx-5807fc1\samples\TimeFliesLikeAnArrow.Silverlight\Time
FliesLikeAnArrow.Silverlight.csproj]


"C:\Temp\fsharp-fsharpx-5807fc1\Fsharpx.WithTypeProviders.sln" (default target)
 (1) ->
"C:\Temp\fsharp-fsharpx-5807fc1\samples\TimeFliesLikeAnArrow.Silverlight\TimeFl
iesLikeAnArrow.Silverlight.csproj" (default target) (12) ->
(CoreCompile target) ->
  MainPage.xaml.cs(5,7): error CS0246: The type or namespace name 'FSharp' coul
d not be found (are you missing a using directive or an assembly reference?) [C
:\Temp\fsharp-fsharpx-5807fc1\samples\TimeFliesLikeAnArrow.Silverlight\TimeFlie
sLikeAnArrow.Silverlight.csproj]

-Shane


Stephen Swensen

unread,
Jul 19, 2012, 8:24:12 PM7/19/12
to fsh...@googlegroups.com
Hi Shane,

I haven't tried building FSharpx.WithTypeProviders.sln before, but a couple comments you made caught my eye:

1) It doesn't matter that your computer is x64, you can compile x86 projects regardless
2) "it says I already have a newer version of silverlight installed and I cannot install silverlight 4": check in your add / remove programs that you don't have any silverlight 5 sdk stuff involved. If you do, uninstall it.
3) I'm surprised that the presumably vs2012 solution FSharpx.WithTypeProviders.sln includes a silverlight 4 project (the F# team has told me that vs2012 F# projects do not and will not support silverlight 4, only silverlight 5).
4) The F# Silverlight 4 SDK can be tough to install, I wrote up some tips for a different project at  http://code.google.com/p/unquote/wiki/DevelopmentEnvironment under "Silverlight 4 Tools".

Best luck,

Stephen

Mauricio Scheffer

unread,
Jul 19, 2012, 10:09:00 PM7/19/12
to fsh...@googlegroups.com
Even if some Silverlight example fails to compile, the main assemblies should still build fine and you should be able to open the WPF sample with VS2012.

--
Mauricio

Shane Delmore

unread,
Jul 20, 2012, 5:08:54 PM7/20/12
to fsh...@googlegroups.com
That was very helpful.  I was banging my head up against the wall trying to get the msbuild to work since it seems to work for others and never succeeded, but the new virtual machine I setup will actually let me play around in the wpf sample even though the main FSharp.WithTypeProviders project will not compile.

-Shane

Shane Delmore

unread,
Jul 20, 2012, 5:10:49 PM7/20/12
to fsh...@googlegroups.com
It is definitely confusing.  I landed in the same place, never got it working and the whole time I was confused on why a visual studio 2012 project that other people seem to be able to compile is targeting silverlight 4 when to the best of my knowledge VS2012 uninstalls silverlight 4 and upgrades you to silverlight 5.

Ryan Riley

unread,
Jul 26, 2012, 1:08:30 PM7/26/12
to fsh...@googlegroups.com
On Thursday, July 19, 2012 7:24:12 PM UTC-5, Stephen Swensen wrote:
3) I'm surprised that the presumably vs2012 solution FSharpx.WithTypeProviders.sln includes a silverlight 4 project (the F# team has told me that vs2012 F# projects do not and will not support silverlight 4, only silverlight 5).
 
 
I imagine this was an oversight by whomever put together that solution. Most of the solutions include everything, and the MiniRx/FSharpx.Observable project for Silverlight still targets SL4. The SL projects in that solution should either be updated to SL5 or removed. I don't recall getting the SL4 stuff working on any machine but one, so I'd be in favor of upgrading all to SL5. 
Reply all
Reply to author
Forward
0 new messages