Microsoft.NET.Sdk.WindowsDesktop์— ๋Œ€ํ•ด์„œ...

.NET Core 3.0์—์„œ Windows Forms์™€ WPF๊ฐ€ ์ฒ˜์Œ ๋„์ž…๋˜์—ˆ์„ ๋•Œ์—๋Š” Microsoft.NET.Sdk.WindowsDesktop ํ”„๋กœ์ ํŠธ SDK๋ฅผ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <OutputType>WinExe</OutputType>
  <TargetFramework>netcoreapp3.0</TargetFramework>
  <UseWindowsForms>true</UseWindowsForms>
  <Nullable>enable</Nullable>
</Project>

๊ทธ๋Ÿฌ๋‹ค๊ฐ€ .NET 5์—์„œ Microsoft.NET.Sdk๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , WindowsDesktop ๊ด€๋ จ ์†์„ฑ๋“ค์€ Windows Forms๋‚˜ WPF๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ž๋™์œผ๋กœ ๋กœ๋“œ๋˜๋Š” ๊ฒƒ์œผ๋กœ ๋ฐ”๋€Œ์—ˆ์Šต๋‹ˆ๋‹ค.

<Project Sdk="Microsoft.NET.Sdk">
  <OutputType>WinExe</OutputType>
  <TargetFramework>net5.0-windows</TargetFramework>
  <UseWindowsForms>true</UseWindowsForms>
  <Nullable>enable</Nullable>
</Project>

.NET 5 ์ด์ƒ์„ ํƒ€๊ฒŸํ•˜๋Š” ํ”„๋กœ์ ํŠธ์—์„œ Microsoft.NET.Sdk.WindowsDesktop์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜๋ฉด NETSDK1137 ๊ฒฝ๊ณ ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

(๋งํฌ์—๋Š” ์˜ค๋ฅ˜๋ผ๊ณ  ๋‚˜์™€ ์žˆ์ง€๋งŒ ์ด๋Š” ์ž˜๋ชป๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ๋Š” ๊ฒฝ๊ณ ๊ฐ€ ๋งž์Šต๋‹ˆ๋‹ค.)

ํ•˜์ง€๋งŒ .NET Framework๋‚˜ .NET Core 3์„ ํƒ€๊ฒŸํ•˜๊ฒŒ ๋˜๋ฉด ์ด๋Ÿฐ ๊ฒฝ๊ณ ๊ฐ€ ๋‚˜์˜ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ์—ฌ๊ธฐ์„œ ๊ถ๊ธˆ์ฆ์ด ์ƒ๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. โ€œ๊ทธ๋Ÿฌ๋ฉด ๊ธฐ์กด .NET Framework๋‚˜ .NET Core 3 ํ”„๋กœ์ ํŠธ๋Š” Microsoft.NET.Sdk.WindowsDesktop์„ ์จ์•ผํ•˜๋‚˜?โ€ ์ œ๊ฐ€ ๊ทธ๋žฌ๊ฑฐ๋“ ์š”.

ํ•˜์ง€๋งŒ ์‹ค์ œ๋กœ๋Š” ๊ทธ๋ ‡์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Microsoft.NET.Sdk ์จ๋„ ์ž˜๋งŒ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ ์ด์œ ๋Š”

์œ„ ๋งํฌ๋ฅผ ๋ณด์‹œ๋ฉด WPF๋‚˜ Windows Forms๋ฅผ ์‚ฌ์šฉํ•˜๊ณ , .NET Core 3.0 ์ด์ƒ์„ ํƒ€๊ฒŸํ•˜๊ฑฐ๋‚˜, .NET Framework๋ฅผ ํƒ€๊ฒŸํ•˜๋ฉด ImportWindowsDesktopTargets ์†์„ฑ์„ true๋กœ ์„ค์ •ํ•˜๊ฒŒ ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ์ฆ‰, ์–ด๋–ค ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์“ฐ๋“  ๊ทธ๋ƒฅ Microsoft.NET.Sdk ์จ๋„ WindowsDesktop ์†์„ฑ์€ ์ž˜๋งŒ ๋กœ๋“œ๋ฉ๋‹ˆ๋‹ค.

์ €๋Š” .NET Core 3์€ ์ง€์› ๋๋‚œ์ง€ ํ•œ์ฐธ ๋์œผ๋‹ˆ๊นŒ ๋„˜์–ด๊ฐ€๊ณ , ์ตœ์†Œํ•œ .NET Framework๋ฅผ ํƒ€๊ฒŸํ•˜๋ฉด ๊ฒฝ๊ณ ๊ฐ€ ๋‚˜๊ฒŒ๋” ํ•ด์•ผ ํ•œ๋‹ค๊ณ  ๋ด…๋‹ˆ๋‹ค.

์จŒ๋“  ๊ฒฐ๋ก ์€ .NET Framework๋ฅผ ํƒ€๊ฒŸํ•˜๋“  .NET Core๋ฅผ ํƒ€๊ฒŸํ•˜๋“  Windows Forms๋‚˜ WPF๋ฅผ ์จ๋„ Microsoft.NET.Sdk ์“ฐ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

4๊ฐœ์˜ ์ข‹์•„์š”