Skip to main content
1-Visitor
March 3, 2016
Solved

.NET SDK first steps to get examples going

  • March 3, 2016
  • 2 replies
  • 5935 views

Hello community,

i already worked with your C SDK and everything was fine.

Right now i tried to get this .NET SDK working to combine it with some c# programms.

I tried the examples with Visual Studio 15 and 10 but couldn't fix ist as i followed the instructions on http://support.ptc.com/cs/help/thingworx_hc/thingworx_edge/index.jspx?id=thingworx15&action=show -> SDK Steam Sensor Example.


But when it comes to:

5. Add the core SDK (twApi.dll) to the project. Reference the version of this file that is appropriate to the processor of your device from the SDK\tw\x86 or SDK\tw\64 folder of the SDK installation.

I am not able to do so:  References -> Add Reference -> Browse twApi.ddl (x64 for my 64Bit System) -->> "A reference ... could not be added"

I also could not find the property "copy to output directory" yet.

So when i try to run the example it just starts and stops again, because if(args.Length < 3) fails.

I think it does not get the configuration because of the missing core SDK.

Do you have any solutions or idea and could please help me?

Thanks a lot!!!

Best answer by riaanl

Try this:

  • Right click on your VS project within your solution
  • Navigate to "Add" in the context menu, and click "Add Existing Item".  Browse to the appropriate version of the TWApi.dll and select it.  This will add the file to the project but not as a reference.
  • Click on the TWApi.dll file within the project.  Once clicked, go to properties of that file (same property pane that you is universally used within Visual Studio).  Change the property called 'Copy to Output Directory' to: Copy if newer.

2 replies

trauhut1-VisitorAuthor
1-Visitor
March 3, 2016

As we figured out your twApi.ddl seams to be corrupt...?

riaanl5-Regular MemberAnswer
5-Regular Member
March 13, 2016

Try this:

  • Right click on your VS project within your solution
  • Navigate to "Add" in the context menu, and click "Add Existing Item".  Browse to the appropriate version of the TWApi.dll and select it.  This will add the file to the project but not as a reference.
  • Click on the TWApi.dll file within the project.  Once clicked, go to properties of that file (same property pane that you is universally used within Visual Studio).  Change the property called 'Copy to Output Directory' to: Copy if newer.

1-Visitor
March 15, 2016

Where can you find the TWApi.dll?  It's not included in the .NET SDK zip file package (MED-61061-CD-055_F000_ThingWorx-DotNet-SDK-5-0-1-103.zip).

1-Visitor
March 15, 2016

I agree, it's not in that download... Is there a specific reason you're using that version? If not try one of the newer versions.