Skip to content

Commit

Permalink
Merge pull request #264 from caioproiete/display-error-when-using-nug…
Browse files Browse the repository at this point in the history
…et-packagereference

Display error message to user if project is using NuGet PackageReference
  • Loading branch information
govert authored Oct 25, 2019
2 parents 3aba729 + ddbaabe commit c5476e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Package/ExcelDna.AddIn/build/ExcelDna.AddIn.targets
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
<ExcelDnaPackRunMultithreaded Condition="'$(ExcelDnaPackRunMultithreaded)' == ''">true</ExcelDnaPackRunMultithreaded>
</PropertyGroup>

<!--
Target that checks if the project is not compatible with Excel-DNA
-->
<Target Name="ExcelDnaCheckPackageProjectStyle" BeforeTargets="CoreCompile">
<Error Text="Excel-DNA is not compatible with projects that use NuGet `PackageReference`. Make sure you create a .NET Framework (Class Library) project and configure Visual Studio to use `packages.config`"
Condition=" '$(PackageReferenceCompatibleProjectStyle)' == 'true' OR '$(RestoreProjectStyle)' == 'ProjectJson' OR '$(NuGetProjectStyle)' == 'PackageReference' " />
</Target>

<!--
Configure debugger options (Path for EXCEL.EXE, add-in to open, etc).
-->
Expand Down

0 comments on commit c5476e6

Please sign in to comment.