Skip to main content
Solved

FME Objects in Visual Studio 2012

  • August 9, 2013
  • 1 reply
  • 19 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

 

 

 

 

 

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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

 

 

 

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings