fix weird dll copying issue
This commit is contained in:
@@ -23,17 +23,17 @@ public static class RoslynTest
|
|||||||
foreach (var document in project.Documents)
|
foreach (var document in project.Documents)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Document: {document.Name}");
|
Console.WriteLine($"Document: {document.Name}");
|
||||||
var compilation = await project.GetCompilationAsync();
|
// var compilation = await project.GetCompilationAsync();
|
||||||
Guard.Against.Null(compilation, nameof(compilation));
|
// Guard.Against.Null(compilation, nameof(compilation));
|
||||||
|
//
|
||||||
// Get diagnostics (built-in or custom analyzers)
|
// // Get diagnostics (built-in or custom analyzers)
|
||||||
var diagnostics = compilation.GetDiagnostics();
|
// var diagnostics = compilation.GetDiagnostics();
|
||||||
|
//
|
||||||
foreach (var diagnostic in diagnostics)
|
// foreach (var diagnostic in diagnostics)
|
||||||
{
|
// {
|
||||||
Console.WriteLine(diagnostic);
|
// Console.WriteLine(diagnostic);
|
||||||
// Optionally run CodeFixProviders here
|
// // Optionally run CodeFixProviders here
|
||||||
}
|
// }
|
||||||
// var syntaxTree = await document.GetSyntaxTreeAsync();
|
// var syntaxTree = await document.GetSyntaxTreeAsync();
|
||||||
// var root = await syntaxTree!.GetRootAsync();
|
// var root = await syntaxTree!.GetRootAsync();
|
||||||
// var classifiedSpans = await Classifier.GetClassifiedSpansAsync(document, root.FullSpan);
|
// var classifiedSpans = await Classifier.GetClassifiedSpansAsync(document, root.FullSpan);
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ public class BuildService
|
|||||||
var buildResult = await BuildManager.DefaultBuildManager.BuildAsync(buildParameters, buildRequest, cancellationToken).ConfigureAwait(false);
|
var buildResult = await BuildManager.DefaultBuildManager.BuildAsync(buildParameters, buildRequest, cancellationToken).ConfigureAwait(false);
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
Console.WriteLine($"Build result: {buildResult.OverallResult} in {timer.ElapsedMilliseconds}ms");
|
Console.WriteLine($"Build result: {buildResult.OverallResult} in {timer.ElapsedMilliseconds}ms");
|
||||||
|
if (buildResult.OverallResult != BuildResultCode.Success)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{buildResult.Exception}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string[] TargetsToBuild(BuildType buildType)
|
private static string[] TargetsToBuild(BuildType buildType)
|
||||||
|
|||||||
2
src/SharpIDE.Application/Program.cs
Normal file
2
src/SharpIDE.Application/Program.cs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
throw new InvalidOperationException("This project is not executable - Exe OutputType is used to work around a build issue.");
|
||||||
@@ -3,11 +3,12 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<OutputType>Exe</OutputType> <!-- Exe output type is required for obscure Microsoft.CodeAnalysis.Workspaces.MSBuild dll copying reasons -->
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- If any Microsoft.Build.dll ends up in the output, it will be prioritised for loading by MSBuild Nodes -->
|
<!-- If any Microsoft.Build.*.dll (Excluding Locator) ends up in the output, it will be prioritised for loading by MSBuild Nodes -->
|
||||||
<PackageReference Include="Ardalis.GuardClauses" Version="5.0.0" />
|
<PackageReference Include="Ardalis.GuardClauses" Version="5.0.0" />
|
||||||
<PackageReference Include="AsyncReadProcess" Version="1.0.0-preview9" />
|
<PackageReference Include="AsyncReadProcess" Version="1.0.0-preview9" />
|
||||||
<PackageReference Include="Microsoft.Build" Version="17.14.8" ExcludeAssets="runtime" />
|
<PackageReference Include="Microsoft.Build" Version="17.14.8" ExcludeAssets="runtime" />
|
||||||
@@ -15,8 +16,8 @@
|
|||||||
<PackageReference Include="Microsoft.Build.Locator" Version="1.9.1" />
|
<PackageReference Include="Microsoft.Build.Locator" Version="1.9.1" />
|
||||||
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.14.8" ExcludeAssets="runtime" />
|
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.14.8" ExcludeAssets="runtime" />
|
||||||
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.14.8" ExcludeAssets="runtime" />
|
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.14.8" ExcludeAssets="runtime" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" ExcludeAssets="runtime" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" ExcludeAssets="runtime" />
|
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.SolutionPersistence" Version="1.0.52" />
|
<PackageReference Include="Microsoft.VisualStudio.SolutionPersistence" Version="1.0.52" />
|
||||||
<PackageReference Include="NuGet.Protocol" Version="6.14.0" />
|
<PackageReference Include="NuGet.Protocol" Version="6.14.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user