Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ComHost generation code from HostModel. #3884

Merged
merged 13 commits into from
Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
280 changes: 0 additions & 280 deletions src/Tasks/Microsoft.NET.Build.Tasks/ClsidMap.cs

This file was deleted.

56 changes: 0 additions & 56 deletions src/Tasks/Microsoft.NET.Build.Tasks/ComHost.cs

This file was deleted.

16 changes: 12 additions & 4 deletions src/Tasks/Microsoft.NET.Build.Tasks/CreateComHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.NET.HostModel.ComHost;

namespace Microsoft.NET.Build.Tasks
{
Expand All @@ -21,10 +22,17 @@ public class CreateComHost : TaskBase

protected override void ExecuteCore()
{
ComHost.Create(
ComHostSourcePath,
ComHostDestinationPath,
ClsidMapPath);
try
{
ComHost.Create(
ComHostSourcePath,
ComHostDestinationPath,
ClsidMapPath);
}
catch (ComHostCustomizationUnsupportedOSException)
{
Log.LogError(Strings.CannotEmbedClsidMapIntoComhost);
}
}
}
}
9 changes: 9 additions & 0 deletions src/Tasks/Microsoft.NET.Build.Tasks/GenerateClsidMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Reflection.PortableExecutable;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.NET.HostModel.ComHost;

namespace Microsoft.NET.Build.Tasks
{
Expand Down Expand Up @@ -40,6 +41,14 @@ protected override void ExecuteCore()
}
}
}
catch (MissingGuidException missingGuid)
{
Log.LogError(Strings.ClsidMapExportedTypesRequireExplicitGuid, missingGuid.TypeName);
}
catch (ConflictingGuidException conflictingGuid)
{
Log.LogError(Strings.ClsidMapConflictingGuids, conflictingGuid.TypeName1, conflictingGuid.TypeName2, conflictingGuid.Guid.ToString());
}
catch (BadImageFormatException)
{
Log.LogError(Strings.ClsidMapInvalidAssembly, IntermediateAssembly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Reflection.PortableExecutable;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.NET.HostModel.ComHost;

namespace Microsoft.NET.Build.Tasks
{
Expand Down
Loading