Language/C#

    [C#] DLL 포함시켜 단일 EXE로 만들기

    [C#] DLL 포함시켜 단일 EXE로 만들기

    프로젝트 파일 설정 프로젝트 파일 내에 PropertyGroup에 아래와 같은 항목을 추가한다. WinExe net6.0-windows ... true true win-x64 true PublishSingleFile : 하나의 파일로 게시(Publish)를 사용하도록 설정 SelfContained : 앱이 자체 포함대상인지, 프레임워크 종속인지 확인 RuntimeIdentifier : 대상으로 하는 OS / CPU 유형 지정 IncludeNativeLibrariesForSelfExtract : 코어 런타임 자체의 네이티브 이진 파일 포함하고 하나의 출력 파일을 얻기 위한 속성 ( 코어 런타임 자체의 네이티브 이진 파일은 단일 파일 번들에 기본적으로 포함되지 않음 ) 배포 (게시 / Publish) 1. ..

    Nested Type 설계 시 주의할 점

    ✓ DO use nested types when the relationship between the nested type and its outer type is such that member-accessibility semantics are desirable. X DO NOT use public nested types as a logical grouping construct; use namespaces for this. X AVOID publicly exposed nested types. The only exception to this is if variables of the nested type need to be declared only in rare scenarios such as subclassi..

    Old csproj to new csproj: Visual Studio 2017 upgrade guide

    http://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/

    What exception should I throw?

    This section describes the standard exceptions provided by the Framework and the details of their usage. The list is by no means exhaustive. Please refer to the .NET Framework reference documentation for usage of other Framework exception types.Exception and SystemExceptionX DO NOT throw System.Exception or System.SystemException.X DO NOT catch System.Exception or System.SystemException in frame..

    C# Singleton Pattern

    http://csharpindepth.com/Articles/General/Singleton.aspx

    [C#] 문자열이 숫자인지 확인하는 방법

    문자열이 지정한 숫자 형식의 유효한 표현인지 확인하려면 모든 기본 숫자 형식에서 구현되며 DateTime 및 IPAddress 같은 형식에서도 구현되는 정적 TryParse 메서드를 사용합니다. 다음 예제에서는 "108"이 유효한 int인지 확인하는 방법을 보여 줍니다. int i = 0; string s = "108"; bool result = int.TryParse(s, out i); //i now = 108 문자열에 비숫자 문자가 포함되어 있는 경우 또는 숫자 값이 지정한 특정 형식에 비해 너무 크거나 너무 작은 경우 TryParse는 false를 반환하고 out 매개 변수를 0으로 설정합니다. 그렇지 않으면 true를 반환하고 out 매개 변수를 문자열의 숫자 값으로 설정합니다. 문제는 형식에 대..