So in VS2010 RC, does your F# project target .NET 2.0? That is, when you right click the project, go to 'properties', go to the 'application tab', is '.NET Framework 2.0' selected as the 'Target Framework'? If so this should compile to DLLs that run on 2.0.

What are the 3 dependencies? Are they just assemblies in the framework, or other projects that are part of your visual studio solution, or 3rd party DLLs, or?

By on 3/29/2010 10:07 PM ()

Hello, thanks for your answer.

Yes, taget framework 2.0 is selected correctly.

Two of the referenced .dlls are c# projects in the solution, they get copied to the output folder. The 3rd is the SlimDX.dll which is third party and located in the "c:\Program Files\Slim DX ..." folder.

One thing with the SlimDX .dll was, that in VS2010 RC I could not add it from the .NET tab in the 'Add Reference' dialog. But in #develop it worked.. Now i checked with VS2005 and there it is available too (besides many others i also dont see in VS2010 RC).

What i did then, was to open the solution created with #develop and let VS2010 do the conversion steps. Then the SlimDX.dll was referenced. When I set 'Copy local' to true SlimDX.dll is even copied to the output dir. I tried to put the SlimDX.dll directly besides my compiled .dll but without success...

Any further ideas I can try?

By on 3/30/2010 7:01 AM ()

When you say it doesn't work, how exactly does it fail?

By on 3/30/2010 8:18 AM ()

The .dll i want to compile gets loaded by a Delphi application via COM. When debugging the Delphi applicattion I get the following exception:

"Erste Gelegenheit für Exception bei $7C812AFB. Exception-Klasse EClrException mit Meldung 'Die Datei oder Assembly "\path\AsseblyName.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Die Assembly wird von einer Laufzeit erstellt, die aktueller als die derzeit geladene Laufzeit ist, und kann nicht geladen werden.'. Prozess vvvv.exe (5660)"

which means something like:

"Can't load the .dll or a dependency of it. The assembly is created by a newer runtime as the one which is currently loaded and can not be loaded."

So, there must be some compiler flag not right.. As it seems to compile not for .NET 2.0 framework..

Maybe I need to reference other .dlls, when I want to run a F# genereated .dll on .NET 2.0 framework?

The .fsproj file looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="utf-8"?>
http://schemas.microsoft.com/developer/msbuild/2003</A>">
  
    {1FEA5C5D-9029-4A8A-A30E-757FACF94DEC}
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    x86
    <OutputType>Library</OutputType>
    <RootNamespace>VVVV.Nodes</RootNamespace>
    <AssemblyName>PluginFSharpTextureTemplateVS</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <TargetFrameworkProfile />
  
  
    x86
  
  
    <OutputPath>bin\Debug\</OutputPath>
    <DebugSymbols>True</DebugSymbols>
    <DebugType>Full</DebugType>
    <Optimize>False</Optimize>
  
  
    <OutputPath>bin\Release\</OutputPath>
    <DebugSymbols>False</DebugSymbols>
    <DebugType>None</DebugType>
    <Optimize>True</Optimize>
  
  <Import Project="$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets" Condition="!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
  <Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
  
    
    
  
  <ItemGroup>
    <Compile Include="PluginFSharpTextureTemplate.fs" />
  </ItemGroup>
  <ItemGroup>
    
      {837C740A-485C-424C-8C38-086ED3DC73CB}
      <Name>PluginInterfaces</Name>
    
    
      {C3773330-81FA-4253-823E-1BDE1529AA99}
      <Name>Utils</Name>
    
    <Reference Include="SlimDX">
      True
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
  </ItemGroup>
By on 3/30/2010 9:34 AM ()

Ok, somehow i got it now.. I tried several combinations of VS and #develop .fsproj files with my .fs file. Now it works for me like this: create a new F# project in VS, select .NET 2.0 target framework, add the .fs file and save all. Then I have to add the reference to SlimDX with a texteditor in the .fsproj, since I cannot select it in VS.

I can live with that..

Regards

By on 3/30/2010 7:56 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper