Skip to content

Commit 2f61a3d

Browse files
code cleanup
1 parent 981b127 commit 2f61a3d

25 files changed

+89
-103
lines changed

Src/BridgeVs.AsyncVsPackage/BridgeVs.VisualStudio.AsyncExtension.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<AppDesignerFolder>Properties</AppDesignerFolder>
3636
<RootNamespace>BridgeVs.VisualStudio.AsyncExtension</RootNamespace>
3737
<AssemblyName>BridgeVs.VisualStudio.AsyncExtension</AssemblyName>
38-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
38+
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
3939
<GeneratePkgDefFile>true</GeneratePkgDefFile>
4040
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
4141
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
@@ -283,6 +283,12 @@
283283
</EmbeddedResource>
284284
</ItemGroup>
285285
<ItemGroup>
286+
<ProjectReference Include="..\..\Lib\SharpRaven\src\app\SharpRaven\SharpRaven.csproj">
287+
<Project>{31fe81f8-6e49-432c-b0b2-658e76f96983}</Project>
288+
<Name>SharpRaven</Name>
289+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
290+
<AdditionalProperties>TargetFramework=net40</AdditionalProperties>
291+
</ProjectReference>
286292
<ProjectReference Include="..\BridgeVs.Build\BridgeVs.Build.csproj">
287293
<Project>{276f3935-e0ca-450f-a55f-aed56dc2024e}</Project>
288294
<Name>BridgeVs.Build</Name>

Src/BridgeVs.AsyncVsPackage/BridgeVsExtension.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
using System.ComponentModel.Design;
2929
using System.IO;
3030
using System.Linq;
31-
using BridgeVs.Shared.Common;
3231
using BridgeVs.VsPackage.Helper;
3332
using BridgeVs.VsPackage.Helper.Command;
3433
using BridgeVs.VsPackage.Helper.Configuration;
@@ -56,6 +55,7 @@ private IEnumerable<Project> AllProjects
5655
{
5756
get
5857
{
58+
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
5959
Projects projects = _application.Solution.Projects;
6060
if (projects == null)
6161
return Enumerable.Empty<Project>();
@@ -97,14 +97,18 @@ public void UpdateCommand(MenuCommand cmd, CommandAction action)
9797

9898
private CommandStates GetStatus(CommandAction action)
9999
{
100+
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
101+
100102
CommandStates result = CommandStates.Visible;
101103

102104
bool isBridgeVsConfigured = PackageConfigurator.IsBridgeVsConfigured(_application.Version);
103105

104106
if (!isBridgeVsConfigured)
105107
return result; //just show it as visible
106108

107-
bool isSolutionEnabled = CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, _application.Version);
109+
string solutionDir = Path.GetDirectoryName(_application.Solution.FileName);
110+
string directoryTarget = Path.Combine(solutionDir, "Directory.Build.targets");
111+
bool isSolutionEnabled = File.Exists(directoryTarget);
108112

109113
if (isSolutionEnabled && action == CommandAction.Disable || !isSolutionEnabled && action == CommandAction.Enable)
110114
result |= CommandStates.Enabled;

Src/BridgeVs.AsyncVsPackage/Command/BridgeCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public static void ActivateBridgeVsOnSolution(CommandAction action, List<Project
7676
if (project.Object is VSProject vsProject && vsProject.References != null)
7777
{
7878
references = from Reference reference in vsProject.References
79+
where reference.Path != null
7980
where reference.SourceProject == null //it means it's an assembly reference
8081
where !reference.Path.Contains(".NETFramework") && !reference.Path.Contains("Microsoft") //no .net framework assembly
8182
select reference.Path;

Src/BridgeVs.AsyncVsPackage/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
</dependentAssembly>
1313
</assemblyBinding>
1414
</runtime>
15-
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
15+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/></startup></configuration>

Src/BridgeVs.Build/BridgeVs.Build.csproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>BridgeVs.Build</RootNamespace>
1212
<AssemblyName>BridgeVs.Build</AssemblyName>
13-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1616
<RestorePackages>true</RestorePackages>
17+
<TargetFrameworkProfile />
1718
</PropertyGroup>
1819
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
1920
<OutputPath>bin\Debug\</OutputPath>
2021
<DefineConstants>TRACE;DEBUG</DefineConstants>
22+
<Prefer32Bit>false</Prefer32Bit>
2123
</PropertyGroup>
2224
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Test|AnyCPU'">
2325
<OutputPath>bin\Test\</OutputPath>
2426
<DefineConstants>TRACE;DEBUG;TEST</DefineConstants>
2527
<DebugType>full</DebugType>
2628
<DebugSymbols>true</DebugSymbols>
29+
<Prefer32Bit>false</Prefer32Bit>
2730
</PropertyGroup>
2831
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deploy|AnyCPU'">
2932
<OutputPath>bin\Deploy\</OutputPath>
@@ -32,12 +35,13 @@
3235
<Optimize>true</Optimize>
3336
<DebugType>pdbonly</DebugType>
3437
<DebugSymbols>true</DebugSymbols>
38+
<Prefer32Bit>false</Prefer32Bit>
3539
</PropertyGroup>
3640
<PropertyGroup>
3741
<SignAssembly>true</SignAssembly>
3842
</PropertyGroup>
3943
<PropertyGroup>
40-
<AssemblyOriginatorKeyFile>..\BridgeVs.VsPackage\Key.snk</AssemblyOriginatorKeyFile>
44+
<AssemblyOriginatorKeyFile>..\BridgeVs.AsyncVsPackage\Key.snk</AssemblyOriginatorKeyFile>
4145
</PropertyGroup>
4246
<ItemGroup>
4347
<Compile Include="SInjection.cs" />
@@ -54,6 +58,7 @@
5458
<ItemGroup>
5559
<ProjectReference Include="..\..\Lib\SharpRaven\src\app\SharpRaven\SharpRaven.csproj">
5660
<Project>{31fe81f8-6e49-432c-b0b2-658e76f96983}</Project>
61+
<AdditionalProperties>TargetFramework=net40</AdditionalProperties>
5762
<Name>SharpRaven</Name>
5863
</ProjectReference>
5964
<ProjectReference Include="..\BridgeVs.DynamicVisualizers\BridgeVs.DynamicVisualizers.csproj">

Src/BridgeVs.Build/Tasks/CleanBuildTask.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ public class CleanBuildTask : ITask
5151
public bool Execute()
5252
{
5353
Log.VisualStudioVersion = VisualStudioVer;
54-
55-
if (!CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, VisualStudioVer))
56-
{
57-
return true;
58-
}
59-
54+
6055
try
6156
{
6257
string visualizerAssemblyName = VisualizerAssemblyNameFormat.GetTargetVisualizerAssemblyName(VisualStudioVer, Assembly);

Src/BridgeVs.Build/Tasks/MapperBuildTask.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,16 @@ public bool Execute()
8181
{
8282
Log.VisualStudioVersion = VisualStudioVer;
8383

84-
if (!CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, VisualStudioVer))
85-
{
86-
return true;
87-
}
88-
8984
Log.Write($"Visualizer Destination Folder Path {VisualizerDestinationFolder}");
9085

91-
9286
Create3RdPartyVisualizers();
9387

94-
//if dot net visualizer exists already don't create it again
95-
if (!FS.FileSystem.File.Exists(Path.Combine(VisualizerDestinationFolder, DotNetVisualizerAssemblyName)))
96-
{
97-
//it creates a mapping for all of the .net types that are worth exporting
98-
CreateDotNetFrameworkVisualizer();
99-
}
88+
//it creates a mapping for all of the .net types that are worth exporting
89+
CreateDotNetFrameworkVisualizer();
10090

10191
CreateDebuggerVisualizer();
10292

10393
return true;
104-
10594
}
10695

10796
private void Create3RdPartyVisualizers()
@@ -183,6 +172,12 @@ private void CreateDebuggerVisualizer()
183172

184173
private void CreateDotNetFrameworkVisualizer()
185174
{
175+
176+
//if dot net visualizer exists already don't create it again
177+
if (FS.FileSystem.File.Exists(Path.Combine(VisualizerDestinationFolder, DotNetVisualizerAssemblyName)))
178+
{
179+
return;
180+
}
186181
try
187182
{
188183
//this is where the current assembly being built is saved

Src/BridgeVs.Build/Tasks/SInjectionBuildTask.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ public class SInjectionBuildTask : ITask
4848
public bool Execute()
4949
{
5050
Log.VisualStudioVersion = VisualStudioVer;
51-
52-
if (!CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, VisualStudioVer))
53-
{
54-
return true;
55-
}
56-
51+
5752
try
5853
{
5954
string snkCertificate = File.Exists(Snk) ? Snk : null;

Src/BridgeVs.Build/app.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
44

55
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
66

77
<dependentAssembly>
88

9-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
9+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
1010

11-
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
11+
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
1212

1313
</dependentAssembly>
1414

1515
</assemblyBinding>
1616
</runtime>
17-
</configuration>
17+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

Src/BridgeVs.Build/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Mono.Cecil" version="0.10.0" targetFramework="net40" />
4-
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net40" />
4+
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net40" requireReinstallation="true" />
55
<package id="System.IO.Abstractions" version="2.1.0.256" targetFramework="net40" />
66
</packages>

0 commit comments

Comments
 (0)