Questions tagged [mixed-mode]

A mixed-mode application is any application that combines native code (C++) with managed code (such as Visual Basic, Visual C#, or C++/CLI that runs on the common language runtime).

From MSDN:

A mixed-mode application is any application that combines native code (C++) with managed code (such as Visual Basic, Visual C#, or C++/CLI that runs on the common language runtime).

Mixed assemblies are capable of containing both unmanaged machine instructions and MSIL instructions. This allows them to call and be called by .NET components, while retaining compatibility with components that are entirely unmanaged. Using mixed assemblies, developers can author applications using a mixture of managed and unmanaged functionality.

249 questions
219
votes
2 answers

What does 'useLegacyV2RuntimeActivationPolicy' do in the .NET 4 config?

While converting a project that used SlimDX, and therefore has unmanaged code, to .NET 4.0 I ran into the following error: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without…
Cameron MacFarland
  • 70,676
  • 20
  • 104
  • 133
39
votes
7 answers

Mixed mode assembly in .NET 4

I wrote a class library in .NET 2.0 for database access some 2 years ago and have been using it all along on .NET 2.0, 3.0 and 3.5. In the current project I'm working on (which is a .NET 4.0 application), tried using the old faithful class library…
Alex Essilfie
  • 12,339
  • 9
  • 70
  • 108
26
votes
4 answers

New SQLite mixed assemblies

Previously .NET SQLite libraries were available from http://sqlite.phxsoftware.com, but they have recently been taken over by the main SQLite team and have moved System.Data.SQLite Download Page. The new packages don't seem to contain mixed…
kay.one
  • 7,622
  • 6
  • 55
  • 74
26
votes
4 answers

ASP.NET MVC and mixed mode authentication

I have a scenario whereby I require users to be able to authenticate against an ASP.NET MVC web application using either Windows authentication or Forms authentication. If the user is on the internal network they will use Windows authentication and…
Alan T
  • 3,294
  • 6
  • 27
  • 27
25
votes
2 answers

Destruction of Native Objects with Static Storage Duration

2012-12-09 Summary: In a normal mixed-mode application global native C++ destructors run as finalizers. It's not possible to change that behavior or the associated timeout. A mixed-mode assembly DLL runs C++ constructors/destructors during DLL…
user786653
  • 29,780
  • 4
  • 43
  • 53
22
votes
5 answers

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

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?
jyoung
  • 5,071
  • 4
  • 30
  • 47
18
votes
2 answers

Using mixed-mode debugging on a managed unit test in Visual Studio 2013

I have a C# unit test in the Visual Studio 2013 test framework which exercises CLI and native code. I would like to investigate the native portion of the code while executing the C# unit test. However running Test -> Debug -> All Tests runs the…
Chris
  • 201
  • 2
  • 6
18
votes
1 answer

c++/cli DLL fails under Win 8.1

i have written a Win32/net DLL, it works fine under Win XP, Win7 and 8 but under Win 8.1 it fails. Dependency Walker says: API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL not found (user32.dll will call them) Google means, MS changed some System-DLLs in…
user3600403
  • 339
  • 1
  • 2
  • 18
16
votes
1 answer

Given the choice, what are the pros/cons of mixed-mode assemblies vs. separate interop DLLs?

When a 3rd-party component is offered in both "mixed-mode assembly" and "separate interop dll" versions, what are the pros and cons of each? A good example is System.Data.SQLite. The above link has this to say: [Mixed-mode assembly] packages should…
misha256
  • 337
  • 3
  • 16
15
votes
2 answers

Access Violation issue with unhandled managed Exceptions in managed C++ .NET application

This is actually a solved problem, but it's so esoteric I thought I'd share it for other users. Also perhaps others might suggest reasons? Anyway, I'm working on a "mixed mode" .NET application written in managed C++, but with heavy links into…
John
  • 1,974
  • 2
  • 25
  • 32
14
votes
6 answers

C++/CLI Mixed Mode DLL Creation

I've got a native C++ DLL that I would like to have a C++/CLI wrapper layer for. From what I understood, if you simple added a C++/CLI class to the project, VS would compile as mixed mode, but I was apparently wrong as VS doesn't seem to be even…
Adam Haile
  • 30,705
  • 58
  • 191
  • 286
14
votes
4 answers

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

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…
Anthony
  • 245
  • 1
  • 2
  • 10
13
votes
4 answers

"skipped loading symbols for ngen binary" for C# dll

I'm trying to debug a C# dll from a native C++ executable. I have a C# COM object that is loaded and run from native code via IDispatch. Everything is built in Debug, both C# and C++ code. Whilst I can see all the c++ code, and all the c++ dlls have…
gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
12
votes
6 answers

Fast capture stack trace on windows / 64-bit / mixed mode

Like most of you probably know there exists plenty of different mechanisms to walk stack traces, starting from windows api, and continuing further into depth of magical assembly world - let me list here some of links I've already studied. For of all…
TarmoPikaro
  • 4,723
  • 2
  • 50
  • 62
11
votes
5 answers

C3859: Virtual memory range for PCH exceeded

I get this error message from time to time (not every time) I compile (EDIT: sorry, I didn't make myself clear here: I actually meant "rebuild") my mixed-mode project. And Visual Studio tells me to "recompile with a command line option of '-Zm114'…
1
2 3
16 17