Skip to content

Commit da62449

Browse files
committed
fix build issues to generate NuGet for SQLAsyncOutputCacheProviders
1 parent 1bf0b84 commit da62449

9 files changed

+228
-156
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
[Bb]in/
33
.vs/
44
msbuild.*
5-
obj/
65
packages/
7-
/TestSQL

MicrosoftAspNetOutputCache.msbuild

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,5 @@
4040
<Exec Command=".nuget\NuGet.exe restore" />
4141
</Target>
4242

43-
<!--
44-
<Target Name="UnitTest">
45-
<ItemGroup>
46-
<TestDLLs Include="test\SystemWebProvidersUnitTest\bin\$(Configuration)\*Test.dll" />
47-
</ItemGroup>
48-
49-
<PropertyGroup>
50-
<TestSettingsFile Condition=" '$(Configuration)' == 'CodeCoverage' ">$(MsBuildProjectDirectory)\test\CodeCoverage.testsettings</TestSettingsFile>
51-
<TestSettingsFile Condition=" '$(Configuration)' != 'CodeCoverage' ">$(MsBuildProjectDirectory)\unittest.testsettings</TestSettingsFile>
52-
</PropertyGroup>
53-
54-
<Delete Files="bin\$(Configuration)-TestResults.trx" />
55-
<Exec
56-
Command="&quot;$(VS100COMNTOOLS)..\IDE\MSTEST.EXE&quot; /nologo /usestderr /resultsfile:&quot;bin\$(Configuration)-TestResults.trx&quot; @(TestDLLs -> '/testcontainer:&quot;%(Identity)&quot;', ' ') /testsettings:&quot;$(TestSettingsFile)&quot;" />
57-
</Target>
58-
-->
5943
<Import Project="tools\MicrosoftAspNetOutputCache.targets"/>
6044
</Project>

src/OutputCacheModuleAsync/OutputCacheHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private async void DependencyRemovedCallback(string key, object value, CacheItem
480480
if (OutputCacheUtilityType != null) {
481481
var flushKernelCacheMethod = OutputCacheUtilityType.GetMethod("FlushKernelCache");
482482
if (flushKernelCacheMethod != null) {
483-
flushKernelCacheMethod.Invoke(dce.KernelCacheUrl, new object[] { });
483+
flushKernelCacheMethod.Invoke(dce.KernelCacheUrl, new object[] {dce.KernelCacheUrl});
484484
}
485485
}
486486
}

src/SQLAsyncOutputCacheProvider/Microsoft.AspNet.OutputCache.SQLAsyncOutputCacheProvider.csproj

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.OutputCache.sln))\tools\MicrosoftAspNetOutputCache.settings.targets" />
45
<PropertyGroup>
56
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
67
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProductVersion>
8-
</ProductVersion>
9-
<SchemaVersion>2.0</SchemaVersion>
108
<ProjectGuid>{062FD141-4E51-4943-8C69-385DDE3D2792}</ProjectGuid>
11-
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
129
<OutputType>Library</OutputType>
1310
<AppDesignerFolder>Properties</AppDesignerFolder>
1411
<RootNamespace>Microsoft.AspNet.OutputCache.SQLAsyncOutputCacheProvider</RootNamespace>
1512
<AssemblyName>Microsoft.AspNet.OutputCache.SQLAsyncOutputCacheProvider</AssemblyName>
1613
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
17-
<UseIISExpress>true</UseIISExpress>
18-
<IISExpressSSLPort />
19-
<IISExpressAnonymousAuthentication />
20-
<IISExpressWindowsAuthentication />
21-
<IISExpressUseClassicPipelineMode />
22-
<UseGlobalApplicationHostFile />
23-
<NuGetPackageImportStamp>
24-
</NuGetPackageImportStamp>
14+
<FileAlignment>512</FileAlignment>
15+
<SccProjectName>SAK</SccProjectName>
16+
<SccLocalPath>SAK</SccLocalPath>
17+
<SccAuxPath>SAK</SccAuxPath>
18+
<SccProvider>SAK</SccProvider>
19+
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
20+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
21+
<TargetFrameworkProfile />
2522
</PropertyGroup>
2623
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2724
<DebugSymbols>true</DebugSymbols>
2825
<DebugType>full</DebugType>
2926
<Optimize>false</Optimize>
30-
<OutputPath>..\..\bin\Debug\</OutputPath>
3127
<DefineConstants>DEBUG;TRACE</DefineConstants>
3228
<ErrorReport>prompt</ErrorReport>
3329
<WarningLevel>4</WarningLevel>
@@ -36,11 +32,32 @@
3632
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3733
<DebugType>pdbonly</DebugType>
3834
<Optimize>true</Optimize>
39-
<OutputPath>bin\</OutputPath>
4035
<DefineConstants>TRACE</DefineConstants>
4136
<ErrorReport>prompt</ErrorReport>
4237
<WarningLevel>4</WarningLevel>
4338
</PropertyGroup>
39+
<PropertyGroup>
40+
<SignAssembly>true</SignAssembly>
41+
</PropertyGroup>
42+
<PropertyGroup>
43+
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
44+
</PropertyGroup>
45+
<PropertyGroup>
46+
<DelaySign>true</DelaySign>
47+
</PropertyGroup>
48+
<ItemGroup>
49+
<Reference Include="System" />
50+
<Reference Include="System.configuration" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Runtime.Caching" />
53+
<Reference Include="System.Web" />
54+
<Reference Include="System.Xml.Linq" />
55+
<Reference Include="System.Data.DataSetExtensions" />
56+
<Reference Include="Microsoft.CSharp" />
57+
<Reference Include="System.Data" />
58+
<Reference Include="System.Net.Http" />
59+
<Reference Include="System.Xml" />
60+
</ItemGroup>
4461
<ItemGroup>
4562
<Compile Include="BinarySerializer.cs" />
4663
<Compile Include="SQLAsyncOutputCacheProvider.cs" />
@@ -53,46 +70,7 @@
5370
<Name>Microsoft.AspNet.OutputCache.OutputCacheModuleAsync</Name>
5471
</ProjectReference>
5572
</ItemGroup>
56-
<ItemGroup>
57-
<Content Include="packages.config" />
58-
</ItemGroup>
59-
<ItemGroup>
60-
<Reference Include="System" />
61-
<Reference Include="System.Configuration" />
62-
<Reference Include="System.Data" />
63-
<Reference Include="System.Runtime.Caching" />
64-
<Reference Include="System.Web" />
65-
</ItemGroup>
66-
<PropertyGroup>
67-
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
68-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
69-
</PropertyGroup>
70-
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
71-
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
72-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
73-
<ProjectExtensions>
74-
<VisualStudio>
75-
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
76-
<WebProjectProperties>
77-
<UseIIS>True</UseIIS>
78-
<AutoAssignPort>True</AutoAssignPort>
79-
<DevelopmentServerPort>18424</DevelopmentServerPort>
80-
<DevelopmentServerVPath>/</DevelopmentServerVPath>
81-
<IISUrl>http://localhost:18424/</IISUrl>
82-
<NTLMAuthentication>False</NTLMAuthentication>
83-
<UseCustomServer>False</UseCustomServer>
84-
<CustomServerUrl>
85-
</CustomServerUrl>
86-
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
87-
</WebProjectProperties>
88-
</FlavorProperties>
89-
</VisualStudio>
90-
</ProjectExtensions>
91-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
92-
<PropertyGroup>
93-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
94-
</PropertyGroup>
95-
</Target>
73+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
9674
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9775
Other similar extension points exist, see Microsoft.Common.targets.
9876
<Target Name="BeforeBuild">
Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<UseIISExpress>true</UseIISExpress>
4+
<ProjectView>ShowAllFiles</ProjectView>
55
</PropertyGroup>
6-
<ProjectExtensions>
7-
<VisualStudio>
8-
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
9-
<WebProjectProperties>
10-
<StartPageUrl>
11-
</StartPageUrl>
12-
<StartAction>CurrentPage</StartAction>
13-
<AspNetDebugging>True</AspNetDebugging>
14-
<SilverlightDebugging>False</SilverlightDebugging>
15-
<NativeDebugging>False</NativeDebugging>
16-
<SQLDebugging>False</SQLDebugging>
17-
<ExternalProgram>
18-
</ExternalProgram>
19-
<StartExternalURL>
20-
</StartExternalURL>
21-
<StartCmdLineArguments>
22-
</StartCmdLineArguments>
23-
<StartWorkingDirectory>
24-
</StartWorkingDirectory>
25-
<EnableENC>True</EnableENC>
26-
<AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
27-
</WebProjectProperties>
28-
</FlavorProperties>
29-
</VisualStudio>
30-
</ProjectExtensions>
316
</Project>

src/SQLAsyncOutputCacheProvider/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,5 @@
2020
[assembly: ComVisible(false)]
2121

2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
23-
[assembly: Guid("062fd141-4e51-4943-8c69-385dde3d2792")]
23+
[assembly: Guid("694a18b1-7b61-4643-853d-63d8362b7cf6")]
2424

25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Revision and Build Numbers
33-
// by using the '*' as shown below:
34-
[assembly: AssemblyVersion("1.0.0.0")]
35-
[assembly: AssemblyFileVersion("1.0.0.0")]

src/SQLAsyncOutputCacheProvider/SQLAsyncOutputCacheProvider.cs

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@
77
using System.Web.Caching;
88

99
/// <summary>
10-
/// Async OutputCache Provider using SQL as storage.
10+
/// Async OutputCache Provider using SQL server as storage.
1111
/// </summary>
1212
public class SQLAsyncOutputCacheProvider : OutputCacheProviderAsync, ICacheDependencyHandler {
1313

14+
#region Private Fields
1415
static SQLHelper sqlUtilityHelper;
16+
#endregion
17+
18+
#region Initialization
19+
/// <summary>
20+
/// Initialize the SQL Async OutputCache Provider
21+
/// </summary>
22+
/// <param name="name"></param>
23+
/// <param name="config"></param>
1524
public override void Initialize(string name, NameValueCollection config) {
1625
if (config == null) {
1726
throw new ArgumentNullException("config");
@@ -22,8 +31,9 @@ public override void Initialize(string name, NameValueCollection config) {
2231
base.Initialize(name, config);
2332
sqlUtilityHelper = new SQLHelper(config);
2433
}
34+
#endregion
2535

26-
#region async methods
36+
#region Public Async Methods
2737
/// <summary>
2838
/// Asynchronously inserts the specified entry into the output cache.
2939
/// </summary>
@@ -65,14 +75,14 @@ public override async Task RemoveAsync(string key) {
6575
}
6676
#endregion
6777

68-
#region sync methods
78+
#region Public Sync methods
6979
/// <summary>
7080
/// Returns a reference to the specified entry in the output cache.
7181
/// </summary>
7282
/// <param name="key"></param>
7383
/// <returns></returns>
7484
public override object Get(string key) {
75-
return GetAsync(key);
85+
return sqlUtilityHelper.Get(key);
7686
}
7787

7888
/// <summary>
@@ -83,7 +93,7 @@ public override object Get(string key) {
8393
/// <param name="utcExpiry"></param>
8494
/// <returns></returns>
8595
public override object Add(string key, object entry, DateTime utcExpiry) {
86-
return AddAsync(key, entry, utcExpiry);
96+
return sqlUtilityHelper.Add(key, entry, utcExpiry);
8797
}
8898

8999
/// <summary>
@@ -93,27 +103,38 @@ public override object Add(string key, object entry, DateTime utcExpiry) {
93103
/// <param name="entry"></param>
94104
/// <param name="utcExpiry"></param>
95105
public override void Set(string key, object entry, DateTime utcExpiry) {
96-
SetAsync(key, entry, utcExpiry);
106+
sqlUtilityHelper.Set(key, entry, utcExpiry);
97107
}
98108

99109
/// <summary>
100110
/// Removes the specified entry from the output cache.
101111
/// </summary>
102112
/// <param name="key"></param>
103113
public override void Remove(string key) {
104-
RemoveAsync(key);
114+
sqlUtilityHelper.Remove(key);
105115
}
106116
#endregion
107117

108-
#region Methods support CacheItemPolicy
109-
118+
#region Public Async Methods that support CacheItemPolicy as Parameter
119+
/// <summary>
120+
/// Async Add method that supports CacheItemPolicy as Parameter
121+
/// </summary>
122+
/// <param name="key"></param>
123+
/// <param name="entry"></param>
124+
/// <param name="cacheItemPolicy"></param>
125+
/// <returns></returns>
110126
public async Task<object> AddAsync(string key, object entry, CacheItemPolicy cacheItemPolicy) {
111-
//TODO: Decide what to work on the monitors
112127
return await sqlUtilityHelper.AddAsync(key, entry, cacheItemPolicy.AbsoluteExpiration.DateTime);
113128
}
114129

130+
/// <summary>
131+
/// Async Set method that supports CacheItemPolicy
132+
/// </summary>
133+
/// <param name="key"></param>
134+
/// <param name="entry"></param>
135+
/// <param name="cacheItemPolicy"></param>
136+
/// <returns></returns>
115137
public async Task SetAsync(string key, object entry, CacheItemPolicy cacheItemPolicy) {
116-
//TODO: Decide what to work on the monitors
117138
await sqlUtilityHelper.SetAsync(key, entry, cacheItemPolicy.AbsoluteExpiration.DateTime);
118139
}
119140
}

0 commit comments

Comments
 (0)