Skip to content

Commit 67a3005

Browse files
committed
Hack to fix vs2013 not installing correctly due to bug in devenv.exe.config BindingRedirect.
1 parent 7c4e689 commit 67a3005

8 files changed

Lines changed: 58 additions & 53 deletions

File tree

‎ClojureExtension.Debugger/ClojureExtension.Debugger.csproj‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
<AssemblyName>ClojureExtension.Debugger</AssemblyName>
1212
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14-
<SccProjectName>SAK</SccProjectName>
15-
<SccLocalPath>SAK</SccLocalPath>
16-
<SccAuxPath>SAK</SccAuxPath>
17-
<SccProvider>SAK</SccProvider>
1814
<TargetFrameworkProfile />
1915
</PropertyGroup>
2016
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

‎ClojureExtension.Deployment/ClojureExtension.Deployment.csproj‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
<Content Include="CodeSnippets\SnippetsIndex.xml">
128128
<IncludeInVSIX>true</IncludeInVSIX>
129129
</Content>
130+
<Content Include="Microsoft.VisualStudio.Package.LanguageService.10.0.dll">
131+
<IncludeInVSIX>true</IncludeInVSIX>
132+
</Content>
130133
<Content Include="Runtimes\ClojureCLR-1.5.0.zip">
131134
<IncludeInVSIX>true</IncludeInVSIX>
132135
</Content>
@@ -280,9 +283,9 @@
280283
<HintPath>..\Dependencies\Visual Studio SDK\Microsoft.VisualStudio.Language.Intellisense.dll</HintPath>
281284
</Reference>
282285
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
283-
<Reference Include="Microsoft.VisualStudio.Package.LanguageService.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
286+
<Reference Include="Microsoft.VisualStudio.Package.LanguageService.10.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=d0a477b1756ef34d, processorArchitecture=MSIL">
284287
<SpecificVersion>False</SpecificVersion>
285-
<HintPath>..\..\..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Package.LanguageService.10.0\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Package.LanguageService.10.0.dll</HintPath>
288+
<HintPath>..\..\..\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Package.LanguageService.10.0\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Package.LanguageService.10.0.dll</HintPath>
286289
</Reference>
287290
<Reference Include="Microsoft.VisualStudio.Project, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b7ed17bb64a9597f, processorArchitecture=MSIL">
288291
<HintPath>..\Dependencies\Microsoft.VisualStudio.Project.dll</HintPath>

‎ClojureExtension.Deployment/ClojurePackage.cs‎

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,38 @@ public sealed class ClojurePackage : ProjectPackage
8080
Metadata _metadata;
8181
ErrorListHelper _errorListHelper;
8282

83-
protected override void Initialize()
83+
protected override void Initialize()
8484
{
85-
base.Initialize();
85+
base.Initialize();
86+
8687
_dte = (DTE2)GetService(typeof(DTE));
8788

8889
_dte.Events.DTEEvents.OnStartupComplete +=
8990
() =>
9091
{
91-
bool restartRequired;
92-
93-
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve;
94-
RegisterProjectFactory(new ClojureProjectFactory(this));
95-
RegisterCommandMenuService();
96-
HideAllClojureEditorMenuCommands();
97-
ShowClojureProjectMenuCommands();
98-
EnableTokenizationOfNewClojureBuffers();
99-
SetupNewClojureBuffersWithSpacingOptions();
100-
EnableMenuCommandsOnNewClojureBuffers();
101-
UnzipRuntimes();
102-
EnableSettingOfRuntimePathForNewClojureProjects(out restartRequired);
103-
104-
if (!restartRequired)
92+
try
10593
{
106-
AfterStartupComplete();
94+
bool restartRequired;
95+
96+
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve;
97+
RegisterProjectFactory(new ClojureProjectFactory(this));
98+
RegisterCommandMenuService();
99+
HideAllClojureEditorMenuCommands();
100+
ShowClojureProjectMenuCommands();
101+
EnableTokenizationOfNewClojureBuffers();
102+
SetupNewClojureBuffersWithSpacingOptions();
103+
EnableMenuCommandsOnNewClojureBuffers();
104+
UnzipRuntimes();
105+
EnableSettingOfRuntimePathForNewClojureProjects(out restartRequired);
106+
107+
if (!restartRequired)
108+
{
109+
AfterStartupComplete();
110+
}
111+
}
112+
catch (Exception e)
113+
{
114+
MessageBox.Show("Unhandled Exception loading vsClojure : " + e.Message + System.Environment.NewLine + "Stack Trace: " + e.StackTrace);
107115
}
108116
};
109117
}
@@ -127,8 +135,8 @@ private void AfterStartupComplete()
127135
}
128136

129137
private void UnzipRuntimes()
130-
{
131-
try
138+
{
139+
try
132140
{
133141
var runtimeBasePath = Path.Combine(GetDirectoryOfDeployedContents(), "Runtimes");
134142
Directory.GetFiles(runtimeBasePath, "*.zip").ToList().ForEach(CompressionExtensions.ExtractZipToFreshSubDirectoryAndDelete);
@@ -158,7 +166,7 @@ private void RegisterCommandMenuService()
158166

159167
private void EnableSettingOfRuntimePathForNewClojureProjects(out bool restartRequired)
160168
{
161-
string deployDirectory = GetDirectoryOfDeployedContents();
169+
string deployDirectory = GetDirectoryOfDeployedContents();
162170
string runtimePath = deployDirectory + "\\Runtimes";
163171
string clrRuntimePath1_5_0 = string.Format("{0}\\{1}-{2}", runtimePath, Constants.CLOJURECLR, Constants.VERSION);
164172

Binary file not shown.

‎ClojureExtension.Deployment/source.extension.vsixmanifest‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Identifier Id="5C19BA4A-D328-4D32-BBEC-230390CA50AD">
44
<Name>vsClojure</Name>
55
<Author>vsClojure</Author>
6-
<Version>2.1.4</Version>
6+
<Version>2.1.5</Version>
77
<Description xml:space="preserve">Support for ClojureCLR and ClojureScript.</Description>
88
<Locale>1033</Locale>
99
<MoreInfoUrl>https://github.com/speige/vsClojure</MoreInfoUrl>

‎ClojureScript Code File/ClojureScript Code File.csproj‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
2323
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
2424
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
25-
<SccProjectName>SAK</SccProjectName>
26-
<SccLocalPath>SAK</SccLocalPath>
27-
<SccAuxPath>SAK</SccAuxPath>
28-
<SccProvider>SAK</SccProvider>
2925
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
3026
<FileUpgradeFlags>
3127
</FileUpgradeFlags>

‎README.txt‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Project:
44

55
Description:
66

7-
A Visual Studio 2012 Extension for ClojureCLR & ClojureScript.
7+
A Visual Studio 2010, 2012, & 2013 Extension for ClojureCLR & ClojureScript.
88

9-
Runtimes 1.5.0 (stable beta) available
9+
Runtimes 1.5.0 available
1010

1111
Features:
1212

@@ -36,10 +36,7 @@ Notes:
3636

3737
Source:
3838

39-
-original-
4039
https://github.com/vsClojure/vsClojure
41-
-fork-
42-
https://github.com/speige/vsClojure
4340

4441
Discussion:
4542

@@ -52,11 +49,16 @@ Installing:
5249

5350
Building:
5451

55-
1.) Install the Visual Studio 2012 SDK.
52+
1.) Install the Visual Studio 2010, 2012, & 2013 SDK.
5653
2.) Clone the vsClojure repository.
5754
3.) Open the vsClojure solution.
5855
4.) Build
5956

57+
Note: There is a bug in the bindingRedirect in devenv.exe.config included in vs2013, breaking all extensions which use Microsoft.VisualStudio.Package.LanguageService.10.0.dll
58+
This causes it to attempt to load Microsoft.VisualStudio.Package.LanguageService.10.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' (version 10 & 12 in same strong name), which does not exist.
59+
The .vsix includes an identical copy of the original .dll which has been resigned with a new strong name. The public key token does not match the original because the dll was not signed by Microsoft.
60+
Please vote to correct this vs2013 bug at http://connect.microsoft.com/VisualStudio/feedback/details/794961/previous-version-assemblies-cannot-load-in-visual-studio-2013-preview
61+
6062
License:
6163

6264
See LICENSE.txt.

‎vsClojure/vsClojure.cljproj‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
<StartupArguments>
1616
</StartupArguments>
1717
<Name>vsClojure</Name>
18-
<SccProjectName>SAK</SccProjectName>
19-
<SccProvider>SAK</SccProvider>
20-
<SccAuxPath>SAK</SccAuxPath>
21-
<SccLocalPath>SAK</SccLocalPath>
2218
</PropertyGroup>
2319
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
2420
<DebugSymbols>true</DebugSymbols>
@@ -49,7 +45,7 @@
4945
</Target>
5046
<Target Name="GetCopyToOutputDirectoryItems" Returns="@(CopyToOutputDirectoryItemsWithTargetPath)">
5147
<ItemGroup>
52-
<CopyToOutputDirectoryItems Include="$(TargetDir)\**\*.clj">
48+
<CopyToOutputDirectoryItems Include="$(TargetDir)\$(MSBuildProjectName)$(TargetExt)">
5349
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5450
</CopyToOutputDirectoryItems>
5551
</ItemGroup>
@@ -72,29 +68,33 @@
7268
</Target>
7369
<Target Name="GetTargetPath" DependsOnTargets="$(GetTargetPathDependsOn)" Returns="@(TargetPath)">
7470
<ItemGroup>
75-
<TargetPath Include="$(TargetDir)\**\*.dll" />
71+
<TargetPath Include="$(TargetDir)\$(MSBuildProjectName)$(TargetExt)" />
7672
</ItemGroup>
7773
</Target>
7874
<Target Name="CoreCompile">
7975
<PropertyGroup>
80-
<ClojureNamespaces>@(Compile -> '%(RelativeDir)%(Filename)', ' ')</ClojureNamespaces>
76+
<ClojureCompileIncludes>@(Compile -> '-i &quot;%(RelativeDir)%(Filename)&quot;', ' ')</ClojureCompileIncludes>
8177
</PropertyGroup>
8278
<Copy SourceFiles="@(Compile)" SkipUnchangedFiles="true" OverwriteReadOnlyFiles="true" DestinationFiles="@(Compile -> '$(OutDir)%(RelativeDir)%(Filename)%(Extension)')" />
83-
<Exec WorkingDirectory="$(OutDir)" Command="&quot;$(ClojureRuntimesDirectory)\Clojure.Compile&quot; $(ClojureNamespaces.Replace('\', '.'))" />
84-
<RemoveDuplicates Inputs="@(Compile -> '$(OutDir)%(RelativeDir)')">
85-
<Output TaskParameter="Filtered" ItemName="SourceDirectories" />
86-
</RemoveDuplicates>
79+
<Exec WorkingDirectory="$(OutDir)" Command="&quot;$(ClojureRuntimesDirectory)\Clojure.Compile&quot; -o &quot;$(MSBuildProjectName)$(TargetExt)&quot; $(ClojureCompileIncludes.Replace('\', '.'))" />
8780
<ItemGroup>
88-
<FileWrites Include="@(Compile -> '$(OutDir)%(RelativeDir)%(Filename)%(Extension)')" />
89-
<FileWrites Include="@(Compile -> '$(OutDir)%(RelativeDir)%(Filename)%(Extension).dll')" />
90-
<FileWrites Include="@(Compile -> '$(OutDir)%(RelativeDir)%(Filename)%(Extension).pdb')" />
91-
<FileWrites Include="@(SourceDirectories)" />
81+
<FileWrites Include="$(MSBuildProjectName)$(TargetExt)"/>
82+
<FileWrites Include="$(MSBuildProjectName).pdb"/>
9283
</ItemGroup>
9384
</Target>
9485
<Target Name="BeforeBuild">
9586
</Target>
9687
<Target Name="AfterBuild">
9788
</Target>
98-
<Target Name="CopyFilesToOutputDirectory" DependsOnTargets="&#xD;&#xA; ComputeIntermediateSatelliteAssemblies;&#xD;&#xA; _CopyFilesMarkedCopyLocal;&#xD;&#xA; _CopySourceItemsToOutputDirectory;&#xD;&#xA; _CopyAppConfigFile;&#xD;&#xA; _CopyManifestFiles;&#xD;&#xA; _CheckForCompileOutputs;&#xD;&#xA; _SGenCheckForOutputs">
89+
<Target Name="CopyFilesToOutputDirectory"
90+
DependsOnTargets="
91+
ComputeIntermediateSatelliteAssemblies;
92+
_CopyFilesMarkedCopyLocal;
93+
_CopySourceItemsToOutputDirectory;
94+
_CopyAppConfigFile;
95+
_CopyManifestFiles;
96+
_CheckForCompileOutputs;
97+
_SGenCheckForOutputs">
98+
9999
</Target>
100100
</Project>

0 commit comments

Comments
 (0)