본문 바로가기

Programming110

[.NET] .NET 인증서 net::ERR_CERT_AUTHORITY_INVALID 에러 해결 방법 오늘 갑자기 브라우저에서 net::ERR_CERT_AUTHORITY_INVALID가 발생했다.certmgr.msc에서 개인용 localhost의 인증서를 조회해 보니 딱 오늘이 만료일이었다.다음과 같이 모든 ASP.NET 인증서를 제거하고 새로운 인증서를 생성한다.dotnet dev-certs https --cleandotnet dev-certs https --trust그런데 나의 경우는 이 이후에도 인증서 에러가 계속되고 있었다.혹시나 하고 visual studio 2022를 재시작하니 그제서야 해결되었다.다음과 같이 오늘 생성된 인증서가 등록된 것을 확인할 수 있었다.참고: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-dev-certs do.. 2024. 7. 29.
C# Coding Style C# 코딩룰이 헷갈릴 때 참고하면 좋을 것 같다.https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/coding-style.md runtime/docs/coding-guidelines/coding-style.md at main · dotnet/runtime.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps. - dotnet/runtimegithub.com 2024. 7. 5.
[Xunit] Assert.Equal vs Assert.Equivalent Assert.Equal의 경우 두 object가 같은지 확인한다. type, value 모두 같아야만 true를 리턴한다.하지만 JSON deserialize 하는 객체의 비교, 배열 원소의 순서는 중요하지 않은 비교 등에서 value가 같은지 싶을 때가 있다.이럴 때는 Assert.Equivalent를 사용하면 Assert.Equal 보다 좀 더 유연한 비교가 가능하다.아래 예시 소스코드를 보면 더 이해가 쉬울 것이다.using System.Text.Json;namespace MyProject.Tests;public class EquivalentTests{ [Fact] public void Test1() { int[] array1 = [1, 2, 3]; int[.. 2024. 5. 28.
[Tauri] React에서 Tauri event handling 하기 react 컴포넌트에서 keydown event를 핸들링하는 방법은 아래와 같다.useEffect(() => { const handleKeydown = function (event: KeyboardEvent): void { if ((event.ctrlKey || event.metaKey) && event.key === 's') { event.preventDefault() void saveFile() } } window.addEventListener('keydown', handleKeydown) return () => { window.removeEventListener('keydown', handleKeydown) }}, []) React에서 Tauri 이벤트를 .. 2024. 5. 8.
[React] useEffect에서 async 사용하기(typescript 예시) React useEffect hook에서 비동기 함수를 지원하지 않기 때문에 다음과 같이 구현해야 한다.useEffect((): void => { const fetchData = async (): Promise => { const data = await fetch(`https://jsonplaceholder.typicode.com/posts/${id}`) if (data.ok) { const json = await data.json() as string console.log(json) } } void fetchData()}, [id])그냥 Promise 체이닝을 사용하는 방법도 있다.useEffect(() => { fetch(`https://jsonplacehol.. 2024. 5. 8.
[Git] 계속 Select an account 창이 나타날 때 어느 날부터 회사에서 업무 중에 아래 팝업이 계속 나타났다. 그런데 아무리 PAT나 내 아이디를 선택해도 잠시 후에 다시 팝업 되면서 나를 괴롭혔다. Stack Overflow를 아무리 찾아보고 여러 방법을 시도해 봐도 며칠 지나 다시 이 현상이 반복됐다. 내가 시도해 본 방법은 다음과 같았다. - Git version upgrade 하기 - credential.helper 설정해 보기 - node_module 지워보기 더 이상 고통받기 싫어서 꼭 해결하겠다 마음먹고 "Why am I being asked to select an account?"에 연결된 문서를 정독하니 결국 원인을 찾게 되었다. 원인은 바로 문구 그대로 하나의 컴퓨터에서 여러 Git 계정을 사용하고 있었기 때문이었다. 나의 경우 아래와.. 2024. 4. 13.
[Flutter] Flutter Windows 빌드 은근히 찾기 힘들었던 flutter windows build 명령어flutter build windows위 경로를 따라가면 exe 파일이 생성된 것을 확인 할 수 있다. init 후 바로 빌드한 용량이 24.7MB 정도 된다. 아래 글의 Tauri의 번들 사이즈와 비교해 보면 차이가 꽤 많이 나는 것을 볼 수 있다. Flutter는 빌드에 Flutter 엔진이 포함되기 때문에 용량이 커진다고 한다. Tauri가 5.2MB 정도임을 생각하면 확실히 차이가 있는 것 같다. 아래에서 확인할 수 있다. https://docs.flutter.dev/platform-integration/windows/building#compiling-with-visual-studio Building Windows apps with.. 2024. 4. 12.
[Tauri] Tauri Windows Installer 빌드 다음 명령어를 통해 간단히 패키징 할 수 있다. pnpm tauri build 아래 경로에 exe 파일이 만들어진다. 여기서 Tauri의 강점인 작은 번들 사이즈를 확인할 수 있다. init 후 바로 빌드한 용량이 5.16MB 정도다. installer를 원한다면 bundle 폴더를 확인하면 된다. - bundle/msi: .msi installer - bundle/nsis: .exe installer 아래에서 확인할 수 있다. https://github.com/HanJaeJoon/blog-examples/tree/main/CrossPlatforms/tauri-example blog-examples/CrossPlatforms/tauri-example at main · HanJaeJoon/blog-exam.. 2024. 4. 12.
[pnpm] windows pnpm 업데이트 pnpm add -g pnpm pnpm을 업데이트하는데 자꾸 아래와 같은 에러가 발생했다. EPERM: operation not permitted, unlink 'C:\Users\UserName\AppData\Local\pnpm\pnpm.EXE' 아래 명령어를 사용했더니 해결됐다. pnpm.cmd add -g pnpm @pnpm/exe https://github.com/pnpm/pnpm/issues/5700#issuecomment-1664294702 Can't upgrade pnpm version: EPERM: operation not permitted, unlink `AppData\Local\pnpm\pnpm.EXE` · Issue #5700 · pnpm/pnpm pnpm version: 7.16.1 .. 2024. 4. 11.