ASP.NET 6

ASP.Net서버에 Serilog를 이용한 File Logging

1. Serilog 패키지 설치// Serilog Package 설치dotnet add package Serilog.AspNetCoredotnet add package Serilog.Sinks.File 2. Program.cs 상단에 Serilog 설정(Log설정이 우선 되어야 이후 에러들이 파일이 남습니다)using Serilog;var builder = WebApplication.CreateBuilder(args);// Serilog configurationLog.Logger = new LoggerConfiguration() .MinimumLevel.Information() .WriteTo.Console() .WriteTo.File("logs/myapp-.txt", rolling..

ASP.NET 2026.04.13

Apple IAP 서버 검증 in ASP.NET Server

1. 일단 Apple에서 .p8키 파일을 받아야합니다.https://appstoreconnect.apple.com/ https://appstoreconnect.apple.com/ appstoreconnect.apple.com위의 주소로 가서 사용자 및 액세스 > 통합(개인 일 경우 여기로 가야함) > App Store Connect API액세스 요청 보통 보안을 위해 전체 API키 생성보다는 보안상 IAP 전용키를 만드는것이 좋다고합니다.따라서 앱 내 구매 탭으로 이동해 여기서 key을 생성해 줍니다. 파일 다운로드 전 체크!Issuer ID: 액세스 요청 후 화면 상단에 나타나는 값입니다.Key ID: 키를 생성하면 목록에 나타나는 10자리 값입니다.다운로드: .p8 파일은 한 번만 다운로드 가능하..

ASP.NET 2026.03.23

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''' WHERE orderId = '') AS Value

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''' WHERE orderId = '') AS Value 위와 같은 오류가 아래의 코드를 했을 때 일어났습니다.FormattableString sql = $"SELECT EXISTS (SELECT 1 FROM {dbTable} WHERE orderId = {productId}) AS Value";int exists = await _dbContext.Database.SqlQuery(sql).SingleAsync(); 이유는 dbTable을 변수로 넣으려고 해서 그..

ASP.NET 2026.03.20

The query uses the 'First'/'FirstOrDefault' operator without 'OrderBy' and filter operators.

warn: Microsoft.EntityFrameworkCore.Query[10103] The query uses the 'First'/'FirstOrDefault' operator without 'OrderBy' and filter operators. This may lead to unpredictable results. 위와 같은 에러가 아래의 코드에서 나왔는데 해결방법은 OrderBy를 넣거나 Single 결과가 나온다고 명시해주는 것 입니다.FormattableString sql = $"SELECT EXISTS (SELECT 1 FROM dbTable WHERE orderId = {productId}) AS Value";int exists = await _dbContext.Databas..

ASP.NET 2026.03.19

Google IAP Verification(검증) at ASP.Net Server (ASP.Net 서버에서 구글 인 앱 결제 검증)

1. GoogleCloud의 서비스 계정으로 들어가 줍니다.https://console.cloud.google.com/iam-admin/serviceaccounts 2. 서비스 계정을 만들어줍니다.1) 서비스 계정 만들기 클릭 2) 서비스 계정 이름 작성 3) GCP(Google Cloud Platform)에서 권한 설정은 따로 필요없다고 합니다.하지만 Google Play Console에서 금융 데이터 권한이 꼭 필요하다고 합니다재무 데이터 보기, 주문 및 취소 설문조사 응답 관리 (체크 필수)주문 및 구독 관리 (체크 필수)만약 넣는다고 하면 프로젝트 > 뷰어(Viewer) 권한(단순 조회 권한)정도만 넣으면 되다고 하네요 4) 액세스 권한이 있는 주 구성원여기는 프로젝트에서 소유자 외..

ASP.NET 2026.03.05

ASP.NET HasNoKey 설정

작업했던 기록을 하는 블로그입니다.기록을 하면서 약간의 오류가 있을 수 있습니다. 사용한 ASP.NET의 버전의 9.0이며EntityFrameworkcORE.MySql의 버전은 8.0.3입니다. 1. DBContext 설정에 PrimaryKey가 있을 때와 없을 때의 차이입니다.using Microsoft.EntityFrameworkCore;namespace MyProject;public class ServerDbContext : DbContext{ public ServerDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) ..

ASP.NET 2026.01.07