Skip to content

Commit 95722e2

Browse files
committed
Update to Excel-DNA 0.34
1 parent 34c10eb commit 95722e2

File tree

4 files changed

+68
-13
lines changed

4 files changed

+68
-13
lines changed

LimitedConcurrencyAsync/AsyncFunctions.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using System.Threading;
34
using System.Threading.Tasks;
45
using System.Threading.Tasks.Schedulers;
@@ -20,16 +21,19 @@ static AsyncFunctions()
2021

2122
public static object Sleep(int seconds)
2223
{
24+
Debug.Print($"Sleep Call: {seconds}");
2325
// The callerFunctionName and callerParameters are internally combined and used as a 'key'
2426
// to link the underlying RTD calls together.
2527
string callerFunctionName = "Sleep";
2628
object callerParameters = new object[] {seconds}; // This need not be an array if it's just a single parameter
2729

28-
return AsyncTaskUtil.RunAsTask(callerFunctionName, callerParameters, _fourThreadFactory, () =>
30+
var result = AsyncTaskUtil.RunAsTask(callerFunctionName, callerParameters, _fourThreadFactory, () =>
2931
{
3032
Thread.Sleep(seconds * 1000);
3133
return "Slept on Thread " + Thread.CurrentThread.ManagedThreadId;
3234
});
35+
Debug.Print($"Sleep Result: {result}");
36+
return result;
3337
}
3438

3539
public static object SleepPerCaller(int seconds)
@@ -51,5 +55,7 @@ public static object SleepPerCaller(int seconds)
5155
});
5256
});
5357
}
58+
59+
5460
}
5561
}

LimitedConcurrencyAsync/LimitedConcurrencyAsync.csproj

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
<Prefer32Bit>false</Prefer32Bit>
3434
</PropertyGroup>
3535
<ItemGroup>
36-
<Reference Include="ExcelDna.Integration">
37-
<HintPath>packages\Excel-DNA.Lib.0.32.0\lib\ExcelDna.Integration.dll</HintPath>
36+
<Reference Include="ExcelDna.Integration, Version=0.34.6373.42344, Culture=neutral, processorArchitecture=MSIL">
37+
<HintPath>packages\ExcelDna.Integration.0.34.6\lib\ExcelDna.Integration.dll</HintPath>
3838
<Private>False</Private>
3939
</Reference>
4040
<Reference Include="System" />
@@ -52,20 +52,21 @@
5252
<Compile Include="Properties\AssemblyInfo.cs" />
5353
</ItemGroup>
5454
<ItemGroup>
55-
<Content Include="LimitedConcurrencyAsync-AddIn.dna">
56-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
57-
</Content>
5855
<None Include="packages.config" />
56+
<None Include="Properties\ExcelDna.Build.props" />
57+
<None Include="LimitedConcurrencyAsync-AddIn.dna" />
5958
<None Include="README.md" />
6059
</ItemGroup>
6160
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6261
<PropertyGroup>
63-
<PostBuildEvent>xcopy "$(ProjectDir)packages\Excel-DNA.0.32.0\tools\ExcelDna.xll" "$(TargetDir)LimitedConcurrencyAsync-AddIn.xll*" /C /Y
64-
xcopy "$(TargetDir)LimitedConcurrencyAsync-AddIn.dna*" "$(TargetDir)LimitedConcurrencyAsync-AddIn64.dna*" /C /Y
65-
xcopy "$(ProjectDir)packages\Excel-DNA.0.32.0\tools\ExcelDna64.xll" "$(TargetDir)LimitedConcurrencyAsync-AddIn64.xll*" /C /Y
66-
"$(ProjectDir)packages\Excel-DNA.0.32.0\tools\ExcelDnaPack.exe" "$(TargetDir)LimitedConcurrencyAsync-AddIn.dna" /Y
67-
"$(ProjectDir)packages\Excel-DNA.0.32.0\tools\ExcelDnaPack.exe" "$(TargetDir)LimitedConcurrencyAsync-AddIn64.dna" /Y</PostBuildEvent>
62+
<PostBuildEvent>
63+
</PostBuildEvent>
6864
</PropertyGroup>
65+
<Import Project="packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna.AddIn.targets" Condition="Exists('packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna.AddIn.targets')" />
66+
<Target Name="EnsureExcelDnaTargetsImported" BeforeTargets="BeforeBuild" Condition="'$(ExcelDnaTargetsImported)' == ''">
67+
<Error Condition="!Exists('packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna.AddIn.targets') And ('$(RunExcelDnaBuild)' != '' And $(RunExcelDnaBuild))" Text="You are trying to build with ExcelDna, but the NuGet targets file that ExcelDna depends on is not available on this computer. This is probably because the ExcelDna package has not been committed to source control, or NuGet Package Restore is not enabled. Please enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
68+
<Error Condition="Exists('packages\ExcelDna.AddIn.0.34.6\tools\ExcelDna.AddIn.targets') And ('$(RunExcelDnaBuild)' != '' And $(RunExcelDnaBuild))" Text="ExcelDna cannot be run because NuGet packages were restored prior to the build running, and the targets file was unavailable when the build started. Please build the project again to include these packages in the build. You may also need to make sure that your build server does not delete packages prior to each build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
69+
</Target>
6970
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
7071
Other similar extension points exist, see Microsoft.Common.targets.
7172
<Target Name="BeforeBuild">
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="ExcelDnaProps">
3+
<!--
4+
If you change properties in this file, they may not come into effect until you:
5+
* Rebuild the solution/project
6+
7+
or
8+
9+
* Close Visual Studio
10+
* Delete .vs folder, if exists
11+
* Delete ProjectName.csproj.user (or equivalent for VB, F#, etc.), if exists
12+
* Delete SolutionName.suo, if exists
13+
* Open your solution/project again in Visual Studio
14+
-->
15+
16+
<!--
17+
Configuration properties for building .dna files
18+
-->
19+
<PropertyGroup>
20+
<!--
21+
Enable/Disable automatic generation of platform-specific versions of .dna files
22+
-->
23+
<ExcelDnaCreate32BitAddIn Condition="'$(ExcelDnaCreate32BitAddIn)' == ''">true</ExcelDnaCreate32BitAddIn>
24+
<ExcelDnaCreate64BitAddIn Condition="'$(ExcelDnaCreate64BitAddIn)' == ''">true</ExcelDnaCreate64BitAddIn>
25+
26+
<!--
27+
Define the suffix used for each platform-specific file e.g. MyAddIn64.dna
28+
-->
29+
<ExcelDna32BitAddInSuffix Condition="'$(ExcelDna32BitAddInSuffix)' == ''"></ExcelDna32BitAddInSuffix>
30+
<ExcelDna64BitAddInSuffix Condition="'$(ExcelDna64BitAddInSuffix)' == ''">64</ExcelDna64BitAddInSuffix>
31+
</PropertyGroup>
32+
33+
<!--
34+
Configuration properties for packing .dna files
35+
-->
36+
<PropertyGroup>
37+
<!--
38+
Enable/Disable packing of .dna files
39+
-->
40+
<RunExcelDnaPack Condition="'$(RunExcelDnaPack)' == ''">true</RunExcelDnaPack>
41+
42+
<!--
43+
Suffix used for packed .xll files e.g. MyAddIn-packed.xll
44+
-->
45+
<ExcelDnaPackXllSuffix Condition="'$(ExcelDnaPackXllSuffix)' == ''">-packed</ExcelDnaPackXllSuffix>
46+
</PropertyGroup>
47+
</Project>
48+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Excel-DNA" version="0.32.0" targetFramework="net45" />
4-
<package id="Excel-DNA.Lib" version="0.32.0" targetFramework="net40" />
3+
<package id="ExcelDna.AddIn" version="0.34.6" targetFramework="net45" />
4+
<package id="ExcelDna.Integration" version="0.34.6" targetFramework="net45" />
55
</packages>

0 commit comments

Comments
 (0)