- Posts: 1
Integrate SAM to C# code
- salmasallem
- Topic Author
Less
More
07 Aug 2023 08:33 #12379
by salmasallem
Integrate SAM to C# code was created by salmasallem
Hi,
I'm trying to use SDK in a C# program, I followed the steps described in the help document by generating the C# code from the desktop application. I was expecting the software to generate C# files but I'm getting C/C++ file (sscapi.h). Also, when I try to import the library ssc64.dll into my project, I get "The reference is invalid or unsupported".
Am I doing something wrong?
Thank you
I'm trying to use SDK in a C# program, I followed the steps described in the help document by generating the C# code from the desktop application. I was expecting the software to generate C# files but I'm getting C/C++ file (sscapi.h). Also, when I try to import the library ssc64.dll into my project, I get "The reference is invalid or unsupported".
Am I doing something wrong?
Thank you
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
08 Aug 2023 10:14 #12393
by pgilman
Replied by pgilman on topic Integrate SAM to C# code
Hi Salma,
There are some errors in the C# code created by SAM's code generator.
1. SAM creates a file named "native-lib.cpp". You can change the extension from ".cpp" to ".cs" if it causes problems with your C# development environment.
2. The declaration of the variable 'time' in each block of code that runs a module is incorrect. The variable type should be 'double' instead of 'float'. Please try changing those variable declarations.
We will fix these problems for the Fall 2023 release: github.com/NREL/SAM/issues/1427 .
Best regards,
Paul.
There are some errors in the C# code created by SAM's code generator.
1. SAM creates a file named "native-lib.cpp". You can change the extension from ".cpp" to ".cs" if it causes problems with your C# development environment.
2. The declaration of the variable 'time' in each block of code that runs a module is incorrect. The variable type should be 'double' instead of 'float'. Please try changing those variable declarations.
We will fix these problems for the Fall 2023 release: github.com/NREL/SAM/issues/1427 .
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman