Skip to content

Commit d66668f

Browse files
author
David Hall
committed
Updated builds to include .NET Standard 2.0
1 parent 4ea6ab1 commit d66668f

File tree

5 files changed

+8
-93
lines changed

5 files changed

+8
-93
lines changed

TaskSchedulerMockup/TaskSchedulerMockup.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
<Compile Include="..\TaskService\Native\ExtensionAttributeFor.NET_2.0.cs">
8585
<Link>Native\ExtensionAttributeFor.NET_2.0.cs</Link>
8686
</Compile>
87+
<Compile Include="..\TaskService\Native\Func.Net2.cs">
88+
<Link>Native\Func.Net2.cs</Link>
89+
</Compile>
8790
<Compile Include="..\TaskService\Native\InteropUtil.cs">
8891
<Link>Native\InteropUtil.cs</Link>
8992
</Compile>

TaskService.sln

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2008
4+
VisualStudioVersion = 15.0.27004.2009
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTaskService", "TestTaskService\TestTaskService.csproj", "{207F8F60-0A74-4959-8623-5D258EB133EB}"
77
ProjectSection(ProjectDependencies) = postProject
@@ -128,6 +128,7 @@ Global
128128
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|ARM.ActiveCfg = Debug|Any CPU
129129
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|ARM.Build.0 = Debug|Any CPU
130130
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
131+
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
131132
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|x64.ActiveCfg = Debug|Any CPU
132133
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|x64.Build.0 = Debug|Any CPU
133134
{7091A61E-0F5C-4FEA-B2F3-2538D53790CD}.Debug|x86.ActiveCfg = Debug|Any CPU

TaskService/TaskService.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net20;net35;net40;net452</TargetFrameworks>
5-
<!--<TargetFramework>netstandard2.0</TargetFramework>-->
4+
<TargetFrameworks>net20;net35;net40;net452;netstandard2.0</TargetFrameworks>
65
<AssemblyName>Microsoft.Win32.TaskScheduler</AssemblyName>
76
<RootNamespace>Microsoft.Win32.TaskScheduler</RootNamespace>
87
<SignAssembly>true</SignAssembly>

TestTaskServiceConsole/Program.cs

+1-89
Original file line numberDiff line numberDiff line change
@@ -14,92 +14,4 @@ static void Main(string[] args)
1414
Console.WriteLine(t.Name);
1515
}
1616
}
17-
}
18-
19-
/*namespace System.Runtime.InteropServices.ComTypes
20-
{
21-
using System.Collections;
22-
23-
[Guid("496B0ABE-CDEE-11d3-88E8-00902754C43A")]
24-
internal interface IEnumerable
25-
{
26-
[DispId(-4)]
27-
IEnumerator GetEnumerator();
28-
}
29-
30-
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00020400-0000-0000-C000-000000000046")]
31-
internal interface IDispatch
32-
{
33-
[PreserveSig]
34-
int GetTypeInfoCount(out int info);
35-
36-
[PreserveSig]
37-
int GetTypeInfo(int iTInfo, int lcid, out ComTypes.ITypeInfo ppTInfo);
38-
39-
void GetIDsOfNames([MarshalAs(UnmanagedType.LPStruct)] Guid iid, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] rgszNames, int cNames, int lcid, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I4)] int[] rgDispId);
40-
41-
void Invoke(int dispIdMember, [MarshalAs(UnmanagedType.LPStruct)] Guid iid, int lcid, ComTypes.INVOKEKIND wFlags, [In, Out] [MarshalAs(UnmanagedType.LPArray)] ComTypes.DISPPARAMS[] paramArray, out object pVarResult, out ComTypes.EXCEPINFO pExcepInfo, out uint puArgErr);
42-
}
43-
44-
internal static class COMHelper
45-
{
46-
public static int GetDispId(object rcw, string methodName)
47-
{
48-
IDispatch dispatchObject = rcw as IDispatch;
49-
if (dispatchObject == null)
50-
{
51-
Console.WriteLine("Passed-in argument is not a IDispatch object");
52-
return -1;
53-
}
54-
55-
56-
int[] dispIds = new int[1];
57-
Guid emtpyRiid = Guid.Empty;
58-
dispatchObject.GetIDsOfNames(
59-
emtpyRiid,
60-
new string[] { methodName },
61-
1,
62-
0,
63-
dispIds);
64-
65-
if (dispIds[0] == -1)
66-
{
67-
Console.WriteLine("Method name {0} cannot be recognized.", methodName);
68-
}
69-
70-
return dispIds[0];
71-
}
72-
73-
public static object Invoke(IDispatch target, int dispId)
74-
{
75-
if (target == null) { Console.WriteLine("Cannot cast target to IDispatch."); return null; }
76-
77-
IntPtr variantArgArray = IntPtr.Zero, dispIdArray = IntPtr.Zero, tmpVariants = IntPtr.Zero;
78-
int argCount = 0;
79-
80-
var paramArray = new ComTypes.DISPPARAMS[1];
81-
paramArray[0].rgvarg = variantArgArray;
82-
paramArray[0].cArgs = argCount;
83-
paramArray[0].cNamedArgs = 0;
84-
paramArray[0].rgdispidNamedArgs = IntPtr.Zero;
85-
86-
ComTypes.EXCEPINFO info = default(ComTypes.EXCEPINFO);
87-
object result = null;
88-
89-
try
90-
{
91-
uint puArgErrNotUsed = 0;
92-
target.Invoke(dispId, new Guid(), 0x0409, ComTypes.INVOKEKIND.INVOKE_FUNC, paramArray, out result, out info, out puArgErrNotUsed);
93-
}
94-
catch (Exception ex)
95-
{
96-
Console.WriteLine("IDispatch.Invoke failed: {0}", ex.Message);
97-
}
98-
99-
return result;
100-
}
101-
102-
[DllImport("ole32.dll")]
103-
internal static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string lpszProgID, out Guid pclsid);
104-
}
105-
}*/
17+
}

TestTaskServiceConsole/TestTaskServiceConsole.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="TaskScheduler" Version="2.6.2" />
19+
<ProjectReference Include="..\TaskService\TaskService.csproj" />
2020
</ItemGroup>
2121

2222
</Project>

0 commit comments

Comments
 (0)