mixed-mode

How to reference an assembly which is built against version 'v2.0.xxx' of the runtime in IronPython 2.7?

无人久伴 提交于 2019-12-13 03:39:53
问题 I am trying to create wrapper for an assembly (thirdPartyDLL) which was built against version 'v2.0.50727' of the runtime. But whenever I try to reference it in IronPython code, it always results in following error IOError: System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. My wrapper is a Class Library only, so there is no app.config or app.exe.config. I

Mixing WebForms and MVC: What should I do with the MasterPage?

无人久伴 提交于 2019-12-12 22:18:49
问题 I want to start migrating a WebForms App to MVC. The process will be gradual, so both systems must co-exist. The question is: Should I have two MasterPages, one for the WebForms pages and other for the MVC views? Is there a way to have only one? 回答1: In ASP.NET MVC the master page should derive from System.Web.Mvc.ViewMasterPage while in classic WebForms from System.Web.UI.MasterPage. If in MVC you use the latter you won't have access to any helpers. Although you could use ViewMasterPage in

C++/CLI: #pragma managed / unmanaged scope

喜欢而已 提交于 2019-12-12 12:17:26
问题 I have a mixed-mode DLL, and a .cpp file in it with both managed and unmanaged code. A simplified repro example looks like this: #include "stdafx.h" #pragma managed // Just for explicitness (doesn't influence results) #include <msclr\marshal.h> void Test() { System::String^ sName = ""; msclr::interop::marshal_context context; context.marshal_as<const TCHAR*>(sName); } //#pragma unmanaged // uncomment this line to get errors This code compiles successfully, however if I uncomment the last line

Observer pattern in c++/cli for mixed managed/unmanaged

和自甴很熟 提交于 2019-12-12 02:24:33
问题 I have a system comprising a C# UI, a C++/CLI mixed mode interop wrapper, and some native c++ projects. What I need to do is set up a system such that the native c++ code can send a log message, and the UI can report it. I set up a native IObservable using this as a template, but then the C# code can't be an observer. My thought was to set up another observer pattern in C++/CLI, which observes the native observer, and to let the C# implement that. I used this as a template but I'm struggling

VS 2012 Debugger - Different Display of String Literals Having \\ Escape Sequence

喜欢而已 提交于 2019-12-11 13:47:15
问题 I have a mixed-mode project which contains both C++ and C# code. Character Set is UNICODE. Following string literal is defined somewhere in the C++ code. LPCTSTR lpctszRegKey = _T( "SOFTWARE\\MICROSOFT\\KEYBOARD\\"); When I select "Native Only" as the 'Local Windows Debugger', following is displayed in the Watch window. lpctszRegKey 0x01054134 L"SOFTWARE\\MICROSOFT\\KEYBOARD\\" const wchar_t * When I select "Mixed" as the 'Local Windows Debugger', following is displayed in the Watch window.

What libraries do I need to link my mixed-mode application to?

試著忘記壹切 提交于 2019-12-11 10:24:32
问题 I'm integrating .NET support into our C++ application. It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl. I'm not allowed to remove the linker flag "/NODEFAULTLIB". (We have our own build management system, not Visual Studio's.) This means I have to specify all necessary libraries: VC runtime and MFC. Other compiler options include "/MD" Next to that: I can't use the linker flag "/FORCE:MULTIPLE" and just add everything :

How can I enable the intellisense on my c++/cli project?

左心房为你撑大大i 提交于 2019-12-11 07:38:01
问题 I am using visual studio 2008 and I have a native c++ project that loads a managed c++ dll, but on the last one, the intellisense doesn't work anymore only for the managed code. This project (dll) has a mixed code (native and managed) and if I write only "::" on a clean line, the intellisense gives me the methods inherits from the base class, like regular, not for the managed code, for example array <String^>^ ContactListToChat; I need help, otherwise I´ll have to fly blind. 回答1: Taken from

Linking to presentationcore.dll in mixed mode DLL

℡╲_俬逩灬. 提交于 2019-12-10 22:38:05
问题 We have a mixed mode DLL written in C++ which wraps native C++ DLLs and exposes managed classes. In the exposed managed classes, we use method arguments of type Vector3D etc., which are part of PresentationCore.DLL. Therefore, the mixed mode C++ code needs to reference PresentationCore.DLL. We do this via #using <PresentationCore.dll> which requires the project's search path to include the folder PresentationCore.dll lives in. This is bad, because these folders vary on different machines, and

Creating a Mixed Mode C++ Bridge from C to C#?

℡╲_俬逩灬. 提交于 2019-12-10 15:56:56
问题 I hope someone can help me with this, I'm mostly a C# developer so my C and C++ skills are bad. I have a native C dll that is a plugin of a larger application. I cross compile this dll for windows on linux using gcc. In the native dll when I create a D3DSurface I want to call a function in a Mixed Mode C++ dll and pass in the pointer to the surface along with a Hwnd/handle. That Mixed Mode C++ should then call my C# managed code. As an example, in C I want to do the following; Hwnd handle;

useLegacyV2RuntimeActivationPolicy=“true” does not work with .NET 4.5

可紊 提交于 2019-12-10 15:41:31
问题 The Top answers here: What does 'useLegacyV2RuntimeActivationPolicy' do in the .NET 4 config? and What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project? did not help. My particular Use-case is .Net 4.5 and above for WinForms and Console apps in VS2015 , while trying to use a .net 2.0 dll Under VS2015, adding the suggested variants of this to projects config file does not help. <configuration> <startup useLegacyV2RuntimeActivationPolicy=