Skip to content

Commit de35904

Browse files
Solution patch fix:
* Update NuGet version * Rename delegate removal handler??
1 parent 0c9dff8 commit de35904

File tree

4 files changed

+41
-30
lines changed

4 files changed

+41
-30
lines changed

.nuget/NuGet.exe

948 KB
Binary file not shown.

.nuget/NuGet.targets

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5-
5+
66
<!-- Enable the restore command to run before builds -->
77
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
88

@@ -11,48 +11,59 @@
1111

1212
<!-- Determines if package restore consent is required to restore packages -->
1313
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14-
14+
1515
<!-- Download NuGet.exe if it does not already exist -->
1616
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
1717
</PropertyGroup>
18-
18+
1919
<ItemGroup Condition=" '$(PackageSources)' == '' ">
2020
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21-
<!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
21+
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
2222
<!--
23-
<PackageSource Include="https://nuget.org/api/v2/" />
23+
<PackageSource Include="https://www.nuget.org/api/v2/" />
2424
<PackageSource Include="https://my-nuget-source/nuget/" />
2525
-->
2626
</ItemGroup>
2727

2828
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
2929
<!-- Windows specific commands -->
3030
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31-
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
3231
</PropertyGroup>
33-
32+
3433
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
3534
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
3635
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
37-
<PackagesConfig>packages.config</PackagesConfig>
36+
</PropertyGroup>
37+
38+
<PropertyGroup>
39+
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
40+
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
41+
</PropertyGroup>
42+
43+
<PropertyGroup>
44+
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
45+
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
3846
</PropertyGroup>
3947

4048
<PropertyGroup>
4149
<!-- NuGet command -->
4250
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
4351
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
44-
52+
4553
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
46-
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
54+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
4755

4856
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
49-
57+
5058
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
5159
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
52-
60+
61+
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
62+
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
63+
5364
<!-- Commands -->
54-
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " </RestoreCommand>
55-
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
65+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
66+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
5667

5768
<!-- We need to ensure packages are restored prior to assembly resolve -->
5869
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
@@ -82,24 +93,24 @@
8293
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
8394
</Target>
8495

85-
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
96+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
8697
<Exec Command="$(RestoreCommand)"
8798
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
88-
99+
89100
<Exec Command="$(RestoreCommand)"
90101
LogStandardErrorAsError="true"
91102
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
92103
</Target>
93104

94105
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
95-
<Exec Command="$(BuildCommand)"
106+
<Exec Command="$(BuildCommand)"
96107
Condition=" '$(OS)' != 'Windows_NT' " />
97-
108+
98109
<Exec Command="$(BuildCommand)"
99110
LogStandardErrorAsError="true"
100111
Condition=" '$(OS)' == 'Windows_NT' " />
101112
</Target>
102-
113+
103114
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
104115
<ParameterGroup>
105116
<OutputFilename ParameterType="System.String" Required="true" />
@@ -118,7 +129,7 @@
118129
119130
Log.LogMessage("Downloading latest version of NuGet.exe...");
120131
WebClient webClient = new WebClient();
121-
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
132+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
122133
123134
return true;
124135
}
@@ -130,4 +141,4 @@
130141
</Code>
131142
</Task>
132143
</UsingTask>
133-
</Project>
144+
</Project>

AdRotator/AdRotatorComponent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ private void WireUpDelegateEvent(object o, string eventName, string message)
471471
Delegate eventDel = Delegate.CreateDelegate(ei.EventHandlerType, handler.Target, handler.Method);
472472

473473
ei.AddEventHandler(o, eventDel);
474-
currentProviderDelegates.Add(new AdProviderDeletage() { instance = o, eventInfo = ei, delegateMethod = eventDel });
474+
currentProviderDelegates.Add(new AdProviderDelegate() { instance = o, eventInfo = ei, delegateMethod = eventDel });
475475
}
476476
catch (Exception)
477477
{
@@ -489,7 +489,7 @@ private void RemoveEventDelegatesFromActiveControl()
489489
}
490490
catch { }
491491
}
492-
currentProviderDelegates = new List<AdProviderDeletage>();
492+
currentProviderDelegates = new List<AdProviderDelegate>();
493493
}
494494

495495
private void DelegateEventHandler(string message)

AdRotator2012.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2012
44
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{E2E6A6A8-5342-4850-A86E-6B1E153EBABC}"
55
EndProject
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{971001F2-7071-4A08-9B11-3FB5312EB721}"
7-
ProjectSection(SolutionItems) = preProject
8-
.nuget\NuGet.Config = .nuget\NuGet.Config
9-
.nuget\NuGet.exe = .nuget\NuGet.exe
10-
.nuget\NuGet.targets = .nuget\NuGet.targets
11-
EndProjectSection
12-
EndProject
136
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4ABF1E81-6B70-40B3-AB38-D69597B69192}"
147
EndProject
158
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdRotatorNuGetPackager", "AdRotatorNuGetPackager\AdRotatorNuGetPackager.csproj", "{0451BAEF-DF2E-4B98-8644-94EE9415E389}"
@@ -32,6 +25,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdRotator.Examples.WinPhone
3225
EndProject
3326
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdRotator.Examples.WinPhone8", "Examples\AdRotator.Examples.WinPhone8\AdRotator.Examples.WinPhone8.csproj", "{B3D94F2E-6999-44C3-94E4-172FB8BE301A}"
3427
EndProject
28+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{40AC4AC7-1799-4B1C-86E4-7A96046DE980}"
29+
ProjectSection(SolutionItems) = preProject
30+
.nuget\NuGet.Config = .nuget\NuGet.Config
31+
.nuget\NuGet.exe = .nuget\NuGet.exe
32+
.nuget\NuGet.targets = .nuget\NuGet.targets
33+
EndProjectSection
34+
EndProject
3535
Global
3636
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3737
CI|Any CPU = CI|Any CPU

0 commit comments

Comments
 (0)