์๋
ํ์ธ์~ ๋ฌธ์ ํด๊ฒฐ์ ์ํด ๋
ธ๋ ฅํ๋ค ํน์ ํด๊ฒฐ ํ๋ ๋ถ์ด ๊ณ์๋ฉด ๊ณต์ ๋ฅผ ํด์ฃผ์ค ์ ์์๊น ํด์ ๊ธ์ ์๋๋ค! ใ
ใ
๊ฐ๋ฐ ํ๊ฒฌ C# .NET 7 ์ด๊ณ COM ์ฐธ์กฐ๋ฅผ ํตํด microsoft.office.interop.excel( Microsoft Excel 16.0 Object Library )๋ฅผ ์ฌ์ฉํ๊ณ ์์์ต๋๋ค.
Window ํ๊ฒฝ ๋น๋์์ Linux ํ๊ฒฝ์์ build๋ฅผ ํ๋ ค๊ณ
dotnet build --os win -a x64
๋ฅผ ํตํด buildํ๋ ค๊ณ ํ๋
/7.0.100-rc.2.22477.23/Microsoft.Common.CurrentVersion.targets(2975,5): error MSB4803: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild. Please use the .NET Framework version of MSBuild. See https://aka.ms/msbuild/MSB4803 for further details.
ํด๋น ์๋ฌ๊ฐ ๋ ์ COM ์ฐธ์กฐ๋ฅผ ์ ๊ฑฐํ๊ณ Nuget package์ ์๋ microsoft.office.interop.excel (15.0.4795.1001)์ ์ฐธ์กฐํ์ฌ build๋ฅผ ํ๋ ํด๋น ์๋ฌ๋ ์ ๊ฑฐ๊ฐ ๋์์ต๋๋ค.
ํ์ง๋ง ์ค์ ๋ก microsoft.office.interop.excel ์ ์ฐธ์กฐํ๋ ์ฝ๋์์ ์๋์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ์ต๋๋ค.
Microsoft Office Interop word Version=15.0 0.0 Culture=neutral, PublicKeyToken=71e9bce111e9429c
ํน์ ํด๋น ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ จ๊ฑฐ๋ ์ฐํํด์ ๋ค๋ฅธ๋ฐฉ๋ฒ์ ์ฌ์ฉํ์ ๋ถ๋ค์ด ์์ผ์๋ฉด ๊ณต์ ๋ถํ๋๋ฆฌ๊ฒ ์ต๋๋ค ใ ใ