mixed-mode

How to call a .NET DLL from a Win32 process?

∥☆過路亽.° 提交于 2019-12-10 03:02:26
问题 What are the options when it comes to using a .NET DLL from a Win32 process? I need to basically use a C# DLL from a Win32 process. I have a possible solution right now that requires adding the C# DLL to the GAC (using RegAsm.exe), then calling the C# DLL via COM wrapped calls. However that solution is pretty heavy. It requires that the .NET DLL be added to the GAC on all machines that are supposed to run this Win32 process. Would it be possible to do this without having to call RegAsm prior

Exception occured While loading dynamically EXE assembly in C++/CLI (Could not load file or assembly ', Version=1.0.3836.39802 …)

与世无争的帅哥 提交于 2019-12-08 02:29:29
问题 I am facing an exception in C++/CLI while dynamically loading assembly which itself creates an EXE in C++/CLI managed mode using Assembly.Load . It successfully loads a DLL assembly, but fails to load EXE assembly and generates the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in TestManager.dll Could not load file or assembly 'testAssembly, Version=1.0.3836.39802, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to load an

C++/CLI Wrapping a Function that Returns a std::shared_ptr

坚强是说给别人听的谎言 提交于 2019-12-07 11:55:19
问题 I'm currently wrapping a C++ class with C++/CLI for .NET interoperability following the standard process of holding a native pointer in a managed class. In one instance, I have a native class that has a function like: std::shared_ptr<BaseChannel> channelData(const int RunNumber); I have already begun creating a wrapper class for BaseChannel . However, if I pass the raw pointer to the constructor of the managed class, there are no guarantees on the lifetime of the object being pointed to by

Exception occured While loading dynamically EXE assembly in C++/CLI (Could not load file or assembly ', Version=1.0.3836.39802 …)

别等时光非礼了梦想. 提交于 2019-12-06 10:43:34
I am facing an exception in C++/CLI while dynamically loading assembly which itself creates an EXE in C++/CLI managed mode using Assembly.Load . It successfully loads a DLL assembly, but fails to load EXE assembly and generates the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in TestManager.dll Could not load file or assembly 'testAssembly, Version=1.0.3836.39802, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Attempt to load an unverifiable executable with fixups` (IAT with more than 2 sections or a TLS section.) Exception from

Mixed language statically linking with gfortran and gcc

倾然丶 夕夏残阳落幕 提交于 2019-12-05 06:45:41
问题 I have some code written in C and Fortran that I want to compile into a statically-linked executable. If I compile the code dynamically (using the -fno-underscoring option for gfortran), it all works fine. However, I want to link it into a .so file, statically linking most of the needed libraries, and then link dynamically to libkrb5 , very much like the method described in this blog post. I followed the steps in the previous blog post, and I managed to compile the .so library without any

Mixed language statically linking with gfortran and gcc

六月ゝ 毕业季﹏ 提交于 2019-12-03 21:42:51
I have some code written in C and Fortran that I want to compile into a statically-linked executable. If I compile the code dynamically (using the -fno-underscoring option for gfortran), it all works fine. However, I want to link it into a .so file, statically linking most of the needed libraries, and then link dynamically to libkrb5 , very much like the method described in this blog post . I followed the steps in the previous blog post, and I managed to compile the .so library without any problems. nm shows that it is in good shape, with my Fortran subroutines and C functions showing up: [...

How do I set a Data Breakpoint in mixed( C#/C++ ) debugging?

那年仲夏 提交于 2019-12-03 08:33:46
问题 I launch my program in C#, which then calls some unmanaged C++. When I break on a line in the unmanaged C++, the 'New Data Breakpoint' menu item is grayed out. Is there anyway around this? 回答1: To set a data breakpoint in the native portion of a mixed mode process, see the answer posted by jyoung. Visual Studio disables data breakpoints when running anything but pure, native code. See this post for a partial explanation why from a VS Program Manager. 回答2: So to do this I had to: set the

SGEN failure: An attempt was made to load an assembly with an incorrect format in VS2008

雨燕双飞 提交于 2019-12-03 06:12:43
I was able to find several similar questions asked and answered, but none of the answers or exact conditions applied to my situation. I have a .NET 3.5 project being built for x64. I also have an x64 mixed mode reference (also targeting .NET 3.5). In Visual Studio 2008, I created a Web Reference which causes SGEN to execute during a Release build to create the helper DLL. If I don't reference the mixed-mode DLL , this works fine. If I do reference the mixed mode DLL, I get this error (xxx is just a placeholder): SGEN : error : An attempt was made to load an assembly with an incorrect format: C

Mixed mode assembly not loading symbol for native C++ pdbs

若如初见. 提交于 2019-12-01 17:30:23
I am working with mixed mode assemblies in C++/CLI. All managed mode assembled pdb's get loaded when successfully in mixed mode assembly, but native dll's and pdb's are not getting loaded even though the information of native pdb's is shown in the Modules pane (i.e. in VS Debug->Windows->Modules). I am using native dll and calling its exported function in mixed assembly in C++/CLI code. Here, functions get called successfully, but native pdb symbols are not loading and all breakpoints in the native code are shown as hollow circle and tool tips says there are no symbols loaded for this. I have

Mixed mode assembly not loading symbol for native C++ pdbs

白昼怎懂夜的黑 提交于 2019-12-01 17:05:22
问题 I am working with mixed mode assemblies in C++/CLI. All managed mode assembled pdb's get loaded when successfully in mixed mode assembly, but native dll's and pdb's are not getting loaded even though the information of native pdb's is shown in the Modules pane (i.e. in VS Debug->Windows->Modules). I am using native dll and calling its exported function in mixed assembly in C++/CLI code. Here, functions get called successfully, but native pdb symbols are not loading and all breakpoints in the