Use C# DLL in Python [closed] - c#

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I have a driver which is written in C#, .NET 4.7.0 and build as DLL. I don't have sources from this driver. I want to use this driver in python application.
I wrapped some functionality from driver into method of another C# project. Then I built it into DLL. I used RGiesecke.DllExport to make one method available in python. When i call this method from python using ctypes, I get WinError -532462766 Windows Error 0xe0434352.
If I exclude driver code and keep only wrapper code in exported method everything runs fine.
Could you please give me some advice how to make this working or help me find better sollution? Moving from python to IronPython is no option here.
Thank you.

PROBLEM CAUSE:
Python didn't run wrapper from directory where it was stored together with driver. That caused problem with loading driver.

Related

"The name 'nameof' does not exist in the current context [Assembly-CSharp]" [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 months ago.
Improve this question
I am following this tutorial on Youtube to begin my first ever Unity/C# project. However, I am stuck at about the 15 minute mark, where he uses
Invoke(nameof(ReloadLevel(), 1.3f));
at which point VSCode and Unity both object because "The name 'nameof' does not exist in the current context [Assembly-CSharp]"
Googling the issue shows this user and this user both being advised to update their programs, but mine are all freshly installed, so I'm not sure what the issue is. I am using VSCode 1.74.2, Unity 2021.3.16f1, and have the C# extension by Microsoft, v1.25.2. I have omnisharp.useModernNet set to false (the issue persists regardless of this being true or false, it seems), and .Net Framework 7.0.10 installed, alongside 4.7.1 .Net Dev Pack, as per the C# plugin instructions.
So far I have attempted to regenerate my "Assembly-CSharp.csproj" in case it was just somehow missing.
However, this hasn't worked. Uninstalling and reinstalling .Net with VSCode closed doesn't seem to have fixed it, either.
My expectation is that something just didn't generate properly - OR that the tutorial I'm following is too outdated (1 year), and there's a better way to call this method now. However, I am not sure how to google for that particular solution. Any help would be appreciated.
It's because of parantheses. You should write
Invoke(nameof(ReloadLevel), 1.3f);
Hope this helps.

C# .NET How i can add code editor C# to my website? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
How i can add code editor C#,which will compile the code in live
I tried something with Ace, but nothing so far
Thank you.
If I understand correctly, you want to propose an input to user. They had C# code (no matter what) and your server executes it.
If yes, take a look at that.
It creates a project and build it in memory before executing it.
Be careful cause if you execute the code no matter what it will be a security breach into your server. For example, someone could execute a code which will download a file onto your server and open a backdoor to it.
Check this site:
https://dotnet.microsoft.com/platform/try-dotnet
This is embeddable .Net compiler which you could use without any preparations and setups

Can not get stdio.h to work in c# in visual studio 2017 [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I can not get stdio.h to work for my console application in visual studio 2017. I have researched for about 3 days now and have found nothing useful. All of the help topics I could find were for c++. It does work when I make a c++ console application but not when I create a c# console application. stdio.h This is the error I get
I am trying to learn c# and I can't figure out how to get this to work so any help would be appreciated.
As others have pointed out, it's because you don't use header files in C#.
The closest equivalent concept is the using directive, which allows you to reference code from other namespaces.
Microsoft has great documentation about this: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/using-directive
Additionally, if you want to look into the contents of the various namespaces of the framework to know which to include, you should check out the API Browser: https://learn.microsoft.com/en-us/dotnet/api/?view=netframework-4.7.1
stdio is the standard input/output library for C. The iostream is the standard input/output library for C++. The "stdio.h" is the header file and "stdio.c" have the implementation. You should not try to use it in a diferent language (C#). It's like trying to use node modules (Javascript) in Perl, Php or Java.
Please note that C++ was created in 1983-85 by Bjarne Stroustrup as an Object Oriented evolution of the C language (Designed in 1972 by Dennis Ritchie).
C# (C sharp) was created in 2000 by Microsoft (with the .net framework). It was influenced by C++ and Java.
You can have an Visual C++ project (and solution) in Visual Studio 2017. Other languages supported are C#, VB.net, F# or Python.

thoughts about antivirus dll [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Currently i've tried the antivirus dll from this site:
http://antivirusscanner.codeplex.com/documentation
After installing this package from nuget i ran the code to scan (and clean) a file.
I got a 'virusnotfound' answer back, but that wasn't what i expected: I had no single antivirus program installed.
Does anyone know if this package contains some function to check if an antivirus program is installed? I want to know for sure if the code works fine.
To be fair, the response it correct: it didn't find a virus. That doesn't say whether or not it had the tools to look very hard. There are only 3 responses:
VirusNotFound
VirusFound
FileNotExist
of those, it sounds like VirusNotFound is the closest.
To check, you could perhaps use EICAR.

Licensing your code in Mono [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm working with some code in Visual Studio. My parter-in-crime fellow developer has suggested that the code also be available to work under Mono. I'm impresed witht he work that is already done in Mono, but I'm very new to Mono, so I don't know what it can/cannot do.
I've already written a class in C# using the .NET LicenseManager object. It writes to the windows registry, so I know I'll have to modify it so that it will use some compiler flags like #if Win32 or #if MONO.
My question is two-fold:
1) Does Mono implement the same LicenseManager class structure?
2) If so, how do you guys lock down your code using LicenseManager in Linux? (i.e. Write to files, use a hardware dongle, compare to hardware serials, etc??)
http://www.mono-project.com/MoMA will show you areas not supported
the current state of mono's implementation at the time I write this indicates it has more than just 'TODO' status but you would have to give it a try for your scenario.

Categories

Resources