주 메뉴 열기

wwiki β

바뀜

Asp.net core mvc

809 바이트 추가됨, 2022년 11월 14일 (월) 02:23
편집 요약 없음
==MySQL=====MySQL에서 마이그레이션 히스토리 테이블 생성===다음 에러메시지가 출력되는 경우에 EFMigrationsHistory' doesn't exist다음 쿼리문을 사용하여 테이블을 생성한다.<syntaxhighlight lang="sql">CREATE TABLE IF NOT EXISTS __EFMigrationsHistory ( MigrationId varchar(150) NOT NULL, ProductVersion varchar(32) NOT NULL, CONSTRAINT PK___EFMigrationsHistory PRIMARY KEY (MigrationId));</syntaxhighlight> ===Identity 적용===
====에러메시지====
EFMigrationsHistoryInvalidOperationException: No coercion operator is defined between types ' doesnSystem.Int16't existand 'System.Boolean'.
===모델=쿼리문====CREATE TABLE IF NOT EXISTS __EFMigrationsHistory (
MigrationId varchar(150) NOT NULL,===컨트롤러===
ProductVersion varchar(32) NOT NULL,===Lazor===
CONSTRAINT PK___EFMigrationsHistory PRIMARY KEY (MigrationId)==dotnet명령어=====실행=== $ /[[usr]]/bin/dotnet run
==[[Service|서비스]] 등록 (for linux);==참고 사이트: https://docs.microsoft.com/ko-kr/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.2
===MySQL Identity 적용서비스 정의 파일 생성=== $ sudo nano /etc/systemd/system/kestrel-helloapp.service
===서비스 파일 정의=에러메시지==<syntaxhighlight lang="ini">[Unit]Description=InvalidOperationException: No coercion operator is defined between types 'System.Int16' and 'System.Boolean'Example .NET Web API App running on Ubuntu
[Service]WorkingDirectory=/var/www/helloappExecStart=/usr/bin/dotnet /var/www/helloapp/helloapp.dllRestart= PostgreSQL always# Restart service after 10 seconds if the dotnet service crashes:RestartSec=10KillSignal=SIGINTSyslogIdentifier=dotnet-exampleUser=www-dataEnvironment=ASPNETCORE_ENVIRONMENT=ProductionEnvironment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]WantedBy==== nuget package ====Installmulti-Package Npgsqluser.EntityFrameworkCore.PostgreSQL target</syntaxhighlight><br />
==== connection string ===="User ID=damienbod;Password=1234;Host=localhost;Port=5432;Database=damienbod;Pooling=true;"[[분류:Asp.net]]
편집
2,431