Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/Tasks/CreateCSharpManifestResourceName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Microsoft.Build.Tasks
/// Base class for task that determines the appropriate manifest resource name to
/// assign to a given resx or other resource.
/// </summary>
[MSBuildMultiThreadableTask]
public class CreateCSharpManifestResourceName : CreateManifestResourceName
{
protected override string SourceFileExtension => ".cs";
Expand Down
14 changes: 11 additions & 3 deletions src/Tasks/CreateManifestResourceName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ namespace Microsoft.Build.Tasks
/// Base class for task that determines the appropriate manifest resource name to
/// assign to a given resx or other resource.
/// </summary>
public abstract class CreateManifestResourceName : TaskExtension
public abstract class CreateManifestResourceName : TaskExtension, IMultiThreadableTask
{
/// <summary>
/// The task environment used for thread-safe file system access. Set by MSBuild for
/// multithreaded execution; defaults to a process-wide fallback for legacy hosting.
/// </summary>
public TaskEnvironment TaskEnvironment { get; set; } = TaskEnvironment.Fallback;


#region Properties
internal const string resxFileExtension = ".resx";
internal const string restextFileExtension = ".restext";
Expand Down Expand Up @@ -190,7 +197,8 @@ internal bool Execute(
}
}

if (FileSystems.Default.FileExists(Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon)))
string conventionProbePath = Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon);
if (FileSystems.Default.FileExists(TaskEnvironment.GetAbsolutePath(conventionProbePath)))
{
dependentUpon = conventionDependentUpon;
}
Expand All @@ -215,7 +223,7 @@ internal bool Execute(
if (isDependentOnSourceFile)
{
string pathToDependent = Path.Combine(Path.GetDirectoryName(fileName), dependentUpon);
binaryStream = createFileStream(pathToDependent, FileMode.Open, FileAccess.Read);
binaryStream = createFileStream(TaskEnvironment.GetAbsolutePath(pathToDependent), FileMode.Open, FileAccess.Read);
}

// Put the task item into a dictionary so we can access it from a derived class quickly.
Expand Down
1 change: 1 addition & 0 deletions src/Tasks/CreateVisualBasicManifestResourceName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.Build.Tasks
/// Base class for task that determines the appropriate manifest resource name to
/// assign to a given resx or other resource.
/// </summary>
[MSBuildMultiThreadableTask]
public class CreateVisualBasicManifestResourceName : CreateManifestResourceName
{
protected override string SourceFileExtension => ".vb";
Expand Down
Loading