Skip to main content
Solved

FME Objects in Visual Studio 2012

  • August 9, 2013
  • 1 reply
  • 28 views

Forum|alt.badge.img
Hello -

 

I've built applications using FME Objects in previous versions of Visual Studio, first back in VB6 then in VB.NET in VS 2005.  I'm now trying to use FME Objects again in C# within VS 2012 and am getting stuck.  Stuck at the very beginnging.

 

 

If I try to include this in a class library I get an FMEOException when it tries to create a session. The operative part of the code is below.

 

IFMEOSession m_pFMESession = null;

System.Collections.Specialized.StringCollection pSettings = new System.Collections.Specialized.StringCollection();

pSettings.Add("FME_DEBUG");

pSettings.Add("BADNEWS");

pSettings.Add("FME_USE_RICH_GEOMETRY");

pSettings.Add("yes");

m_pFMESession = FMEObject.CreateSession(); // Fails here

 

 

I've been told that FME Objects was built with an older version of the .NET library so I need to include an App.Config to reference the old runtime.   My App.Config looks like this:

 

 

<?xml version="1.0"?>

<configuration>

<startup useLegacyV2RuntimeActivationPolicy="true">

<supportedRuntime version="v2.0.50727"/></startup>

</configuration>

Still no luck though.   Is anyone using FME Objects in VS 2012?  Any information on how you've got it to work would be much appreciated.

 

 

 

Thanks,

 

Ed

 

 

 

 

 

 

 

 

 

 

 

 

Best answer by e_blair

Phil from Safe Tech Support helped me solve this.  Basically I needed to change the "Platform Target" on the project "Build" tab from "Any CPU" to "x86".  After changing this parameter the reference to the FMEObjects library was  resolved and my code compiled.

 

 

There's a developer sample project in the install directory under \\fmeobjects\\samples that shows this as well.

 

 

Ed

 

 

 

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

Forum|alt.badge.img
  • Author
  • Best Answer
  • August 19, 2013
Phil from Safe Tech Support helped me solve this.  Basically I needed to change the "Platform Target" on the project "Build" tab from "Any CPU" to "x86".  After changing this parameter the reference to the FMEObjects library was  resolved and my code compiled.

 

 

There's a developer sample project in the install directory under \\fmeobjects\\samples that shows this as well.

 

 

Ed