Skip to content

Commit

Permalink
removed templatebuilder dll from vsix
Browse files Browse the repository at this point in the history
  • Loading branch information
psulek committed Dec 4, 2021
1 parent 237d4a2 commit b7576d5
Show file tree
Hide file tree
Showing 7 changed files with 2,144 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/VsExtension2022/VsExtension2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@
<PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="TemplateBuilder">
<Version>1.1.6.1</Version>
<PackageReference Include="TemplateBuilder" Version="1.1.6.1">
<IncludeAssets>none</IncludeAssets>
<PrivateAssets>none</PrivateAssets>
</PackageReference>
<PackageReference Include="VSSDK.TemplateWizardInterface">
<Version>12.0.4</Version>
Expand Down
2,032 changes: 2,032 additions & 0 deletions src/VsExtension2022/envdte-upgrade/TemplateBuilder-result.lhqres

Large diffs are not rendered by default.

Binary file added src/VsExtension2022/envdte-upgrade/image001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/VsExtension2022/envdte-upgrade/info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ildasm /text "{Extension Assembly}.dll" /output:result.txt
10 changes: 10 additions & 0 deletions tools/FoundEnvDteRef/FoundEnvDteRef.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
25 changes: 25 additions & 0 deletions tools/FoundEnvDteRef/FoundEnvDteRef.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FoundEnvDteRef", "FoundEnvDteRef.csproj", "{43D88079-36A8-42DB-B7F8-5D8D0A9B5C75}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{43D88079-36A8-42DB-B7F8-5D8D0A9B5C75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43D88079-36A8-42DB-B7F8-5D8D0A9B5C75}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43D88079-36A8-42DB-B7F8-5D8D0A9B5C75}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43D88079-36A8-42DB-B7F8-5D8D0A9B5C75}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D80566A1-605F-471F-B612-627D586C35FB}
EndGlobalSection
EndGlobal
73 changes: 73 additions & 0 deletions tools/FoundEnvDteRef/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System.Diagnostics;

if (args.Length == 0)
{
Console.WriteLine("Expect parameter with directory path.");
return;
}

var sourceFolder = args[0];
if (Directory.Exists(sourceFolder))
{
const string ildasm = @"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\ildasm.exe";
var tempPath = Path.Combine(Path.GetTempPath(), $"ildasm-scan-{Guid.NewGuid():N}");
Directory.CreateDirectory(tempPath);

var dllFiles = Directory.GetFiles(sourceFolder, "*.dll", SearchOption.AllDirectories);
Console.WriteLine($"Found {dllFiles.Length} files in folder: {sourceFolder}");

int idx = 0;
int failed = 0;
foreach (var dllFile in dllFiles)
{
idx++;
var fileInfo = new FileInfo(dllFile);
string progress = $"({idx}/{dllFiles.Length})";
Console.WriteLine($"Scanning file: {dllFile} {progress} ...");
string outputFile = Path.Combine(tempPath, Path.GetFileNameWithoutExtension(dllFile) + "-result.lhqres");
try
{
var process = Process.Start(new ProcessStartInfo(ildasm, $"/text \"{dllFile}\" /output:\"{outputFile}\""));
if (process != null)
{
process.WaitForExit(30 * 1000);
if (process.ExitCode == 0)
{
Console.WriteLine($"\tScan of file: {fileInfo.Name} {progress} completed successfully.");
}
else
{
failed++;
Console.WriteLine($"\tScan of file: {fileInfo.Name} {progress} failed with exit code: {process.ExitCode}.");
}
}
else
{
Console.WriteLine($"Failed to scan file: {fileInfo.Name} {progress}, could not start scan ildasm on file!");
}
}
catch (Exception e)
{
Console.WriteLine($"Failed to scan file: {fileInfo.Name} {progress}, error: {e.Message}");
}
}

var filesToRemove = from file in Directory.GetFiles(tempPath, "*.*", SearchOption.TopDirectoryOnly)
let fileInfo = new FileInfo(file)
where fileInfo.Extension != ".lhqres"
select file;

foreach (var file in filesToRemove)
{
File.Delete(file);
}

Console.WriteLine($"Scanning ended for {dllFiles.Length} files in folder: {sourceFolder}");
Console.WriteLine($"\t{failed} files failed on scan");
Console.WriteLine($"\t{dllFiles.Length-failed} files succeed on scan");
Console.WriteLine($"Result files can be found at:\n{tempPath}");
}
else
{
Console.WriteLine($"Directory {sourceFolder} does not exist!");
}

0 comments on commit b7576d5

Please sign in to comment.