Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일

C# - Rapsberry Pi Zero W와 PC 간 Bluetooth 통신 예제 코드

일전에 소개한 Rapsberry Pi Zero W(이하 rpi)는,

윈도우즈 사용자를 위한 라즈베리 파이 제로 W 모델을 설정하는 방법
; https://www.sysnet.pe.kr/2/0/11372

(무선 랜과 함께) 블루투스(Bluetooth 4.1)를 내장하고 있습니다. 그럼 지난번의 실습에 이어,

C# - 32feet.NET을 이용한 PC 간 Bluetooth 통신 예제 코드
; https://www.sysnet.pe.kr/2/0/12004

이번에는 블루투스 서버를 C++로 구현해 rpi에 설치하고 PC에서는 C#으로 만든 블루투스 클라이언트를 만들어 볼까요? ^^




지난 글에도 언급했지만, 블루투스 통신을 하려면 그전에 반드시 pairing을 해야 합니다. rpi의 경우 대개는 명령어 모드로 부팅할 것이기 때문에 pairing 과정도 명령어로 진행해야 한다는 점이 약간 수고스럽습니다. 우선 Pairing 신청은 간편하게 윈도우 PC 측에서 하면 좋습니다. 이를 위해 윈도우에서 "Settings" / "Devices" / "Bluetooth & other devices"에서 + 모양의 "Add Bluetooth or other device" 버튼을 누릅니다. 그럼 다음과 같은 화면이 뜨고,

window_bluetooth_add_device_1.png

위의 화면에서 "Bluetooth"를 선택하면 이제 주변 기기 탐색을 시작합니다.

그럼, rpi가 탐색될 수 있도록 SSH 연결을 한 후 sudo 권한으로 bluetoothctl 명령어를 실행합니다.

$ sudo apt-get update && sudo apt-get upgrade -y
$ sudo apt-get install bluetooth blueman bluez

# bluetoothctl
Agent registered
[bluetooth]#

보는 바와 같이 bluetooth 명령어 처리로 바뀌는데 간단하게 "show" 명령어를 이용해 rpi의 블루투스 환경 설정을 조회할 수 있습니다.

[bluetooth]# show
Controller BF:32:A1:CD:82:EF (public)
        Name: raspberrypi
        Alias: raspberrypi
        Class: 0x00480000
        Powered: yes
        Discoverable: no
        Pairable: yes
        UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree Audio Gateway   (0000111f-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0532
        Discovering: no
BluetoothPolicy.BluetoothUUID
; https://docs.samsungknox.com/devref/knox-sdk/reference/com/samsung/android/knox/bluetooth/BluetoothPolicy.BluetoothUUID.html

Bluetooth Low Energy
; https://www.digi.com/resources/documentation/digidocs/90001547/reference/bsp/r_bluetooth_ble.htm

Headset AG - HSP(Headset Profile)
  Headset Profile (HSP) Acts as an audio gateway alone.

Generic Attribute Profile - GATT(Generic Attribute Profile)
  Used to transfer data between BLE devices.

A/V Remote Control - AVRCP(Audio/Video Remote Control Profile)
  Allows sending command frames to a target.

Generic Access Profile - GAP(Generic Access Profile)
  Controls connections and advertisements between devices.

PnP Information

A/V Remote Control Target - AVRCP(Audio/Video Remote Control Profile)
  Allows receiving command frames and generating response frames.

Audio Source - A2DP(Advanced Audio Distribution Profile)
  Acts as a source of digital audio data and sends the stream to the sink

Handsfree Audio Gateway - HFP(Hands-Free Profile)
  Acts as an audio gateway alone.

출력 결과에 따라 "Discoverable: no"인데, 이걸 true로 바꿔야 윈도우의 블루투스 기기 검색에 나타나게 됩니다. 그래서 다음의 명령어를 내립니다.

[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller BF:32:A1:CD:82:EF Discoverable: yes

[CHG] Device 7C:5C:F8:DB:08:0C Connected: yes
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C Modalias: bluetooth:v0006p0001d0A00
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 00001115-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 0000111f-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 7C:5C:F8:DB:08:0C UUIDs: c7f94713-891e-496a-a0e7-983a0946126e
[CHG] Device 7C:5C:F8:DB:08:0C ServicesResolved: yes
[CHG] Device 7C:5C:F8:DB:08:0C Paired: yes
[CHG] Device 7C:5C:F8:DB:08:0C ServicesResolved: no
[CHG] Device 7C:5C:F8:DB:08:0C Connected: no

위의 명령어를 수행하자마자 윈도우 PC 측의 기기 선택 목록에 rpi가 나타나고 이를 선택하면 pairing 과정이 간단하게 완료됩니다.




pairing이 완료되었으면 이제 블루투스 서버 용 프로그램을 만들어 rpi 측에서 실행해야 하는데요. 이를 위해 2개의 빌드 도구를 설치합니다.

# apt install build-essential
# apt install libbluetooth-dev

그런 다음 아래의 글에 공개된 소스 코드를,

BluetoothTest/C BlueZ Server/
; https://github.com/RyanGlScott/BluetoothTest/tree/master/C%20BlueZ%20Server

Raspberry Pi 3 블루투스 페어링 방법(bluetoothctl) 및 C언어 블루투스 서버 예제
; https://webnautes.tistory.com/1137

Visual Studio의 리눅스 프로젝트 템플릿을 이용해,

Visual Studio 2017에서 Raspberry Pi C++ 응용 프로그램 제작
; https://www.sysnet.pe.kr/2/0/11358

작성하면 윈도우 PC에서 디버깅까지 가능한 환경을 제공받으며 편리하게 서버 프로그램을 마무리할 수 있습니다.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
#include <bluetooth/rfcomm.h>
#include <sys/wait.h>
#include <pthread.h>
#include <signal.h>

// https://github.com/RyanGlScott/BluetoothTest/tree/master/C%20BlueZ%20Server
// https://webnautes.tistory.com/1137

void* ThreadMain(void* argument);
bdaddr_t bdaddr_any = { 0, 0, 0, 0, 0, 0 };
bdaddr_t bdaddr_local = { 0, 0, 0, 0xff, 0xff, 0xff };

int _str2uuid(const char* uuid_str, uuid_t* uuid) {
    /* This is from the pybluez stack */

    uint32_t uuid_int[4];
    char* endptr;

    if (strlen(uuid_str) == 36) {
        char buf[9] = { 0 };

        if (uuid_str[8] != '-' && uuid_str[13] != '-' &&
            uuid_str[18] != '-' && uuid_str[23] != '-') {
            return 0;
        }
        // first 8-bytes
        strncpy(buf, uuid_str, 8);
        uuid_int[0] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;
        // second 8-bytes
        strncpy(buf, uuid_str + 9, 4);
        strncpy(buf + 4, uuid_str + 14, 4);
        uuid_int[1] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;

        // third 8-bytes
        strncpy(buf, uuid_str + 19, 4);
        strncpy(buf + 4, uuid_str + 24, 4);
        uuid_int[2] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;

        // fourth 8-bytes
        strncpy(buf, uuid_str + 28, 8);
        uuid_int[3] = htonl(strtoul(buf, &endptr, 16));
        if (endptr != buf + 8) return 0;

        if (uuid != NULL) sdp_uuid128_create(uuid, uuid_int);
    }
    else if (strlen(uuid_str) == 8) {
        // 32-bit reserved UUID
        uint32_t i = strtoul(uuid_str, &endptr, 16);
        if (endptr != uuid_str + 8) return 0;
        if (uuid != NULL) sdp_uuid32_create(uuid, i);
    }
    else if (strlen(uuid_str) == 4) {
        // 16-bit reserved UUID
        int i = strtol(uuid_str, &endptr, 16);
        if (endptr != uuid_str + 4) return 0;
        if (uuid != NULL) sdp_uuid16_create(uuid, (uint16_t)i);
    }
    else {
        return 0;
    }

    return 1;
}

sdp_session_t* register_service(uint8_t rfcomm_channel) {

    const char* service_name = "Armatus Bluetooth server";
    const char* svc_dsc = "A HERMIT server that interfaces with the Armatus Android app";
    const char* service_prov = "Armatus";

    uuid_t root_uuid, l2cap_uuid, rfcomm_uuid, svc_uuid;

    sdp_list_t* l2cap_list = 0;
    sdp_list_t* rfcomm_list = 0;
    sdp_list_t* root_list = 0;
    sdp_list_t* proto_list = 0;
    sdp_list_t* access_proto_list = 0;

    sdp_data_t* channel = 0;
    sdp_record_t record = { 0 };
    sdp_session_t* session = 0;

    _str2uuid("00000004-0000-1000-8000-00805F9B34FB", &svc_uuid);
    sdp_set_service_id(&record, svc_uuid);

    char str[256] = "";
    sdp_uuid2strn(&svc_uuid, str, 256);
    printf("Registering UUID %s\n", str);

    // make the service record publicly browsable
    sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
    root_list = sdp_list_append(0, &root_uuid);
    sdp_set_browse_groups(&record, root_list);

    // set l2cap information
    sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID);
    l2cap_list = sdp_list_append(0, &l2cap_uuid);
    proto_list = sdp_list_append(0, l2cap_list);

    // register the RFCOMM channel for RFCOMM sockets
    sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID);
    channel = sdp_data_alloc(SDP_UINT8, &rfcomm_channel);
    rfcomm_list = sdp_list_append(0, &rfcomm_uuid);
    sdp_list_append(rfcomm_list, channel);
    sdp_list_append(proto_list, rfcomm_list);

    access_proto_list = sdp_list_append(0, proto_list);
    sdp_set_access_protos(&record, access_proto_list);

    // set the name, provider, and description
    sdp_set_info_attr(&record, service_name, service_prov, svc_dsc);

    // connect to the local SDP server, register the service record,
    // and disconnect
    session = sdp_connect(&bdaddr_any, &bdaddr_local, SDP_RETRY_IF_BUSY);
    sdp_record_register(session, &record, 0);

    // cleanup
    sdp_data_free(channel);
    sdp_list_free(l2cap_list, 0);
    sdp_list_free(rfcomm_list, 0);
    sdp_list_free(root_list, 0);
    sdp_list_free(access_proto_list, 0);

    return session;
}

int read_int32(int client) 
{
    char buf[4] = { 0 };
    int bytes_read = read(client, buf, 4);

    if (bytes_read == 4) 
    {
        int length = *(int*)buf;
        printf("received-int32 [%d]\n", length);
        return length;
    }
     
    return 0;
}

int write_int32(int client, int value)
{
    char* buf = (char*)& value;
    int written = write(client, buf, 4);

    if (written == 4)
    {
        printf("written-int32 [%d]\n", 4);
        return 4;
    }

    return 0;
}

char *read_string(int client) 
{
    int len = read_int32(client);
    if (len == 0)
    {
        return nullptr;
    }
    
    char* buf = new char[len + 1];
    memset(buf, 0, sizeof(len + 1));

    int totalRead = 0;

    while (true)
    {
        int bytes_read = read(client, buf + totalRead, len * sizeof(buf[0]));
        if (bytes_read == len) 
        {
            printf("received [%s]\n", buf);
            return buf;
        }
        else if (bytes_read == 0)
        {
            delete[] buf;
            return nullptr;
        }

        len -= bytes_read;
        totalRead += bytes_read;
    }
}

int write_string(int client, char *buf, int bufLen)
{
    int written = write_int32(client, bufLen);
    if (written == 0)
    {
        return 0;
    }

    int totalWrite = 0;

    while (true)
    {
        int bytes_write = write(client, buf + totalWrite, bufLen * sizeof(buf[0]));
        if (bytes_write == bufLen)
        {
            printf("sent [%s]\n", buf);
            return totalWrite;
        }
        else if (bytes_write == 0)
        {
            delete[] buf;
            return 0;
        }

        bufLen -= bytes_write;
        totalWrite += bytes_write;
    }
}

int main()
{
    pthread_t thread_id;

    signal(SIGPIPE, SIG_IGN);

    int port = 3, result, sock, client;
    struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };
    char buffer[1024] = { 0 };
    socklen_t opt = sizeof(rem_addr);

    // local bluetooth adapter
    loc_addr.rc_family = AF_BLUETOOTH;
    loc_addr.rc_bdaddr = bdaddr_any;
    loc_addr.rc_channel = (uint8_t)port;

    // register service
    sdp_session_t* session = register_service((uint8_t)port);
    if (session == nullptr)
    {
        printf("SDP Service registration failed\n");
        return 1;
    }

    // allocate socket
    sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
    printf("socket() returned %d\n", sock);

    // bind socket to port 3 of the first available
    result = bind(sock, (struct sockaddr*) & loc_addr, sizeof(loc_addr));
    printf("bind() on channel %d returned %d\n", port, result);

    // put socket into listening mode
    result = listen(sock, 1);
    printf("listen() returned %d\n", result);

    while (1)
    {
        // accept one connection
        printf("calling accept()\n");
        client = accept(sock, (struct sockaddr*) & rem_addr, &opt);
        printf("accept() returned %d\n", client);

        ba2str(&rem_addr.rc_bdaddr, buffer);
        fprintf(stderr, "accepted connection from %s\n", buffer);
        memset(buffer, 0, sizeof(buffer));

        pthread_create(&thread_id, NULL, ThreadMain, (void*)client);
    }
}

void* ThreadMain(void* argument)
{
    pthread_detach(pthread_self());
    int client = (int)argument;

    while (true)
    {
        char* recv_message = read_string(client);
        if (recv_message == nullptr) {
            printf("client disconnected\n");
            break;
        }

        printf("%s\n", recv_message);

        write_string(client, recv_message, strlen(recv_message));

        delete[] recv_message;
    }

    printf("disconnected\n");
    close(client);

    return 0;
}

참고로 원래 소스 코드는 Serial Port 통신이 가능하도록 되어 있지만 저는 지난 글에서처럼 Socket 프로그래밍 처리를 위해 TCP_PROTOCOL_UUID 서비스를 등록하도록 바꿨습니다.

(서버 프로젝트는 DotNetSamples/Cpp/rpi/btserver github에 올려져 있습니다.)




아마도, 빌드가 완료된 (제 경우에 btserver.out) 실행 파일을 구동 시 다음과 같은 Segmentation fault 오류가 발생할 것입니다.

$ ./projects/btserver/bin/ARM/Debug/btserver.out
Registering UUID 00001101-0000-1000-8000-00805f9b34fb
Segmentation fault (또는, github 소스의 경우 "SDP Service registration failed")

문제가 되는 코드는 sdp_connect인데,

session = sdp_connect(&bdaddr_any, &bdaddr_local, SDP_RETRY_IF_BUSY);
sdp_record_register(session, &record, 0);

그 함수의 반환 값이 null인 경우 sdp_record_register가 nullptr 값을 사용하면서 segfault가 발생하는 것입니다. 이를 해결하려면 bluetoothd 데몬 실행 시 "--compat" 인자를 추가해야 하는데, "/etc/systemd/system/bluetooth.target.wants/bluetooth.service" 또는 "/etc/systemd/system/dbus-org.bluez.service" 파일을 편집기에서 열어 ExecStart 행을 다음과 같이 변경해 저장합니다.

ExecStart=/usr/lib/bluetooth/bluetoothd --compat

변경 사항을 반영하기 위해 서비스를 재시작합니다.

# systemctl daemon-reload
# systemctl restart bluetooth.service

하지만 그래도 여전히 Segmentation fault 오류가 발생할 텐데, 그 이유는 sdp_connect 함수가 bluetoothd 데몬과 통신 시 /var/run/sdp 유닉스 소켓을 사용하는데 이에 대한 권한이 없기 때문입니다.

# ls /var/run/sdp -l
srw-rw---- 1 root root 0 Aug 13 00:04 /var/run/sdp

결국 예전에 겪었던 그 현상입니다. ^^

C# - .NET Core Unix Domain Socket 사용 예제
; https://www.sysnet.pe.kr/2/0/11963

따라서 해당 유닉스 소켓에 대한 권한을 다음과 같이 조정해야 합니다.

# chmod 766 /var/run/sdp
# ls /var/run/sdp -l
srwxrw-rw- 1 root root 0 Aug 13 00:04 /var/run/sdp

그런데, 여기서 끝이 아닙니다. 또 하나의 문제는, bluetoothd가 /var/run/sdp 유닉스 소켓을 여는 것이기 때문에 해당 서비스가 재시작되면 언제나 "srw-rw----" 권한으로 초기화된다는 점입니다. "Raspberry Pi 3 블루투스 페어링 방법(bluetoothctl) 및 C언어 블루투스 서버 예제" 글에 보면, 부팅하는 시점에 적용하도록 .bashrc에 해당 명령어를 넣어 놓으면 된다고 하지만, 경우에 따라 systemctl restart를 하거나 bluetoothd 데몬이 비정상 종료해 다시 시작하는 경우라면 수작업으로 chmod 명령어를 수행해야 합니다.

그런 면을 고려했을 때, 개인적으로는 .bashrc보다는 service 파일에 직접 Post 작업으로 등록하는 것을 더 권장합니다.

ExecStart=/usr/lib/bluetooth/bluetoothd --compat
ExecStartPost=chmod 766 /var/run/sdp




준비는 모두 끝났습니다. 윈도우의 블루투스 클라이언트는 DeviceName 판정만 바꾼 지난번 예제 코드를 그대로 사용해,

private static void bluetoothComponent_DiscoverDevicesProgress(object sender, DiscoverDevicesEventArgs e)
{
    foreach (var item in e.Devices)
    {
        if (item.DeviceName != "raspberrypi")
        {
            continue;
        }

        Guid serviceUUID = BluetoothService.TcpProtocol; // new Guid("00000004-0000-1000-8000-00805F9B34FB");

        BluetoothClient bluetoothClient = new BluetoothClient();
        bluetoothClient.Connect(item.DeviceAddress, serviceUUID);

        Console.WriteLine("Connected");
        bluetoothClient.Client.WriteString("Hello");
        string result = bluetoothClient.Client.ReadString();
        Console.WriteLine(result);

        bluetoothClient.Close();
        Console.WriteLine("Closed");
    }
}

접속하면 정상적으로 소켓 통신이 되는 것을 확인할 수 있습니다.

(첨부 파일은 블루투스 C# 클라이언트 / C++ 서버 프로젝트를 함께 담고 있습니다. - github 예제의 경우 프로젝트가 분리되어 올라가 있어 혼동이 될 수 있으므로.)




참고로, raspberry pi에서의 기타 bluetooth 명령어는 help 명령어로 더 자세하게 볼 수 있습니다.

[bluetooth]# help
Menu main:
Available commands:
-------------------
advertise                                         Advertise Options Submenu
scan                                              Scan Options Submenu
gatt                                              Generic Attribute Submenu
list                                              List available controllers
show [ctrl]                                       Controller information
select <ctrl>                                     Select default controller
devices                                           List available devices
paired-devices                                    List paired devices
system-alias <name>                               Set controller alias
reset-alias                                       Reset controller alias
power <on/off>                                    Set controller power
pairable <on/off>                                 Set controller pairable mode
discoverable <on/off>                             Set controller discoverable mode
agent <on/off/capability>                         Enable/disable agent with given capability
default-agent                                     Set agent as the default one
advertise <on/off/type>                           Enable/disable advertising with given type
set-alias <alias>                                 Set device alias
scan <on/off>                                     Scan for devices
info [dev]                                        Device information
pair [dev]                                        Pair with device
trust [dev]                                       Trust device
untrust [dev]                                     Untrust device
block [dev]                                       Block device
unblock [dev]                                     Unblock device
remove <dev>                                      Remove device
connect <dev>                                     Connect device
disconnect [dev]                                  Disconnect device
menu <name>                                       Select submenu
version                                           Display version
quit                                              Quit program
exit                                              Quit program
help                                              Display help about this program
export                                            Print evironment variables




기타, 컴파일 시 다음과 같은 오류가 발생한다면,

btserver.c:8:10: fatal error: bluetooth/bluetooth.h: No such file or directory
 #include <bluetooth/bluetooth.h>
          ^~~~~~~~~~~~~~~~~~~~~~~

libbluetooth-dev를 설치하면 해결됩니다.

# apt install libbluetooth-dev




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 5/4/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 16  17  [18]  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13169정성태11/23/20225593Windows: 212. 윈도우의 Protected Process (Light) 보안 [1]파일 다운로드2
13168정성태11/22/20224874제니퍼 .NET: 31. 제니퍼 닷넷 적용 사례 (9) - DB 서비스에 부하가 걸렸다?!
13167정성태11/21/20224905.NET Framework: 2070. .NET 7 - Console.ReadKey와 리눅스의 터미널 타입
13166정성태11/20/20224633개발 환경 구성: 651. Windows 사용자 경험으로 WSL 환경에 dotnet 런타임/SDK 설치 방법
13165정성태11/18/20224541개발 환경 구성: 650. Azure - "scm" 프로세스와 엮인 서비스 모음
13164정성태11/18/20225458개발 환경 구성: 649. Azure - 비주얼 스튜디오를 이용한 AppService 원격 디버그 방법
13163정성태11/17/20225380개발 환경 구성: 648. 비주얼 스튜디오에서 안드로이드 기기 인식하는 방법
13162정성태11/15/20226457.NET Framework: 2069. .NET 7 - AOT(ahead-of-time) 컴파일
13161정성태11/14/20225699.NET Framework: 2068. C# - PublishSingleFile로 배포한 이미지의 역어셈블 가능 여부 (난독화 필요성) [4]
13160정성태11/11/20225627.NET Framework: 2067. C# - PublishSingleFile 적용 시 native/managed 모듈 통합 옵션
13159정성태11/10/20228798.NET Framework: 2066. C# - PublishSingleFile과 관련된 옵션 [3]
13158정성태11/9/20225111오류 유형: 826. Workload definition 'wasm-tools' in manifest 'microsoft.net.workload.mono.toolchain' [...] conflicts with manifest 'microsoft.net.workload.mono.toolchain.net7'
13157정성태11/8/20225759.NET Framework: 2065. C# - Mutex의 비동기 버전파일 다운로드1
13156정성태11/7/20226668.NET Framework: 2064. C# - Mutex와 Semaphore/SemaphoreSlim 차이점파일 다운로드1
13155정성태11/4/20226187디버깅 기술: 183. TCP 동시 접속 (연결이 아닌) 시도를 1개로 제한한 서버
13154정성태11/3/20225654.NET Framework: 2063. .NET 5+부터 지원되는 GC.GetGCMemoryInfo파일 다운로드1
13153정성태11/2/20226928.NET Framework: 2062. C# - 코드로 재현하는 소켓 상태(SYN_SENT, SYN_RECV)
13152정성태11/1/20225557.NET Framework: 2061. ASP.NET Core - DI로 추가한 클래스의 초기화 방법 [1]
13151정성태10/31/20225674C/C++: 161. Windows 11 환경에서 raw socket 테스트하는 방법파일 다운로드1
13150정성태10/30/20225711C/C++: 160. Visual Studio 2022로 빌드한 C++ 프로그램을 위한 다른 PC에서 실행하는 방법
13149정성태10/27/20225639오류 유형: 825. C# - CLR ETW 이벤트 수신이 GCHeapStats_V1/V2에 대해 안 되는 문제파일 다운로드1
13148정성태10/26/20225629오류 유형: 824. msbuild 에러 - error NETSDK1005: Assets file '...\project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFramew
13147정성태10/25/20224756오류 유형: 823. Visual Studio 2022 - Unable to attach to CoreCLR. The debugger's protocol is incompatible with the debuggee.
13146정성태10/24/20225585.NET Framework: 2060. C# - Java의 Xmx와 유사한 힙 메모리 최댓값 제어 옵션 HeapHardLimit
13145정성태10/21/20225845오류 유형: 822. db2 - Password validation for user db2inst1 failed with rc = -2146500508
13144정성태10/20/20225696.NET Framework: 2059. ClrMD를 이용해 윈도우 환경의 메모리 덤프로부터 닷넷 모듈을 추출하는 방법파일 다운로드1
... 16  17  [18]  19  20  21  22  23  24  25  26  27  28  29  30  ...