You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NetOffice packages used the PowerShell script to configure the project file with correct EmbedInteropTypes setting. As we moved to the dotnet pack format of packages, these PowerShell scripts are no longer used.
We must update packages so NetOffice libraries are referenced using the <EmbedInteropTypes>False</EmbedInteropTypes> setting.
Adding the NetOfficeFw.Excel v1.9.1 package to a new .NET Framework console application project which used the packages.config file to manage NuGet packages will produce project which cannot be compiled:
// error CS1752: Interop type 'Core' cannot be embedded. Use the applicable interface instead.
NetOffice.Core.Default.Console.WriteLine("NetOffice bug #371");// error CS1752: Interop type 'Application' cannot be embedded. Use the applicable interface instead.varapp=new NetOffice.ExcelApi.Application();
NuGet will add <EmbedInteropTypes>True</EmbedInteropTypes> setting by default:
NetOffice packages used the PowerShell script to configure the project file with correct
EmbedInteropTypes
setting. As we moved to thedotnet pack
format of packages, these PowerShell scripts are no longer used.We must update packages so NetOffice libraries are referenced using the
<EmbedInteropTypes>False</EmbedInteropTypes>
setting.See https://github.com/NuGet/Samples/tree/main/NuGet.Samples.Interop
See https://stackoverflow.com/questions/46353244/embed-interop-types-to-false-in-nuget-package
See https://github.com/NuGet/Home/wiki/Embed-Interop-Types-with-PackageReference
The text was updated successfully, but these errors were encountered: