티스토리 뷰

728x90
반응형

asp.net api 생성에 web.config파일이 생성되지 않아 403 에러가 발생했음

csproj 파일은 아래처럼

 
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsWebConfigRequired>true</IsWebConfigRequired>
<!-- <OutputType>WinExe</OutputType> -->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.9" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
</ItemGroup>

</Project>


publish는 아래처럼해서 해결되었음.

dotnet publish -c Release -r win-x64 --self-contained false

반응형
댓글