Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:53:52+00:00 2026-05-22T14:53:52+00:00

I have a custom .Net interface written in C++/CLI: public interface class IBackgroundExtractor {

  • 0

I have a custom .Net interface written in C++/CLI:

public interface class IBackgroundExtractor
{
};

In my C# application, the interface is used by:

private IBackgroundExtractor extractor = null;

The above code runs smoothly in my computer (which installed visual studio) but it crashed in another one (without installing visual studio):

AppName: speedtest.exe   AppVer: 1.0.0.0     ModName: kernel32.dll
ModVer: 5.1.2600.5512    Offset: 00012aeb

If I remove the null assignment, the code will run in both computer:

private IBackgroundExtractor extractor;

However, I made another interface in pure C#. Setting the interface to null will not make the program to crash:

interface IAnotherInterface
{
}
private IAnotherInterface test = null;

What’s wrong in my C++/CLI interface?

[Remarks]

I’ve create two ‘clean’ new projects for testing, the first one is a C++/CLI Class Library (New Project -> Visual C++ -> CLR -> Class Library). Add the following lines into the .h file of the library:

public interface class ITest {
};

Then create a Windows Form Application project (Net Project -> Visual C# -> Windows -> Windows Forms Application) and declares an ITest variable in the main function:

static void Main()
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new Form1());

    ITest xxx = null;
}

The program will run in the development computer (installed visual studio) but crash in two other computers. One of the crashed computers is physical machine and the other one is an virtual machine.

I am using Windows XP Pro SP3, Visual Studio 2010 and .Net Framework 4.0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:53:53+00:00Added an answer on May 22, 2026 at 2:53 pm

    Have you checked to make sure the right version of the Microsoft Visual C++ Runtime is installed on the target machines? (Your development environment will already have this installed, but no current version of Windows includes this runtime by default).

    If you set up your C++/CLI project to use “SAFE” mode, it will not reference the Microsoft Visual c++ runtime at all (just .NET). See this for reference: Pure and Verifiable Code. If you need to do native stuff, then there’s a very high chance that you need to have the latest Visual C++ runtime installed. You can pick up the redistributable here: Microsoft Visual C++ 2010 Redistributable Package.

    If you want to verify that this is the problem, you can use the sxstrace tool to diagnose these issues (helpful tutorial).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET application that uses a custom .NET library (a .DLL file).
I have a custom control that inherits from .NET's CompositeControl class. This control overrides
So i have a custom CMS running under .Net 3.5 written entirely in c#.
I have single-thread windows form application written with VB.NET and targeting Framework 1.1 .
I have an ASP.NET MVC web application that implements a custom membership provider. The
I have a custom type Money for my ViewModel: public class Money { public
I have an application written in C# targeting .NET Compact Framework 3.5, running on
I have an ADO.NET Data service that I run through WCF: public class AdminService
In my asp.net application, I have the below static class to handle query strings
Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.