Skip to main content
Any Framework

The library to link against the code translated from C# to C++ CodePorting.Translator automated code translator

Published
Sep 15, 2026
1mo ago
Total Downloads
322.5K
322,504

Install

dotnet add package CodePorting.Translator.Cs2Cpp.Framework --version 26.9.0

No framework information available.

README

Description

CodePorting.Translator Cs2Cpp is a framework capable of translating C# code to C++. The resulting code provides the same API original .Net code had and can run in the translated (unmanaged) C++ environment.

CodePorting.Translator.Cs2Cpp.Framework package contains a C++ Library with a substitution for .Net classes and some service code. The translated code is ultimately dependent on this component.

If you use the full CodePorting.Translator Cs2Cpp package to translate your code, this library is already included in it, and you don't need to manage this dependency manually as the translator will generate CMake project files with proper references. However, if you're planning to distribute your translated code, providing the dependency on CodePorting.Translator.Cs2Cpp.Framework Nuget package (where applicable) is the easiest way to do so. Alternatively, you may ask your clients to download respectful CodePorting.Translator.Cs2Cpp packages from the CodePorting website.

Always make sure that the version of the translator used to translate your code matches the version of the CodePorting.Translator.Cs2Cpp.Framework package you use. Failing to do so can result in compilation and/or runtime errors, since the API may change between the versions.

Usage

The types from this package can be used in the client's code to interact with the translated code. Please make sure to use proper smart pointer wrappers for class-like types. For more information, please refer to the product documentation.

#include <system/string.h>
#include <system/console.h>
#include <system/collections/list.h>
#include <MyTranslatedProject/MyTranslatedClass.h>

using namespace System;
using namespace System::Collections::Generic;
using namespace MyTranslatedProject;

int main(int, char*[])
{
    auto list = MakeObject<List<String>>();
    list->Add(u"Apple");
    list->Add(u"Banana");
    list->Add(u"Apricot");
    list->Sort();

    auto myobj = MakeObject<MyTranslatedClass>();
    list = myobj->Process(list);

    for (const auto &item : list)
        Console::WriteLine(item);
    return 0;
}

Resources

Changes from Previous Version

No structural changes between v26.8.0 and v26.9.0.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.