Skip to content

Commit 1a43082

Browse files
Ensure that System.Drawing facade assembly is built before the tests that consume it are. (#13119)
This is an attempt to fix intermittent MSB3106 failures that appeared after we removed project reference to the System.Drawing facade assembly from the System.Windows.Forms.Tests and Microsoft.VisualBasic.Forms.Tests projects. https://dnceng.visualstudio.com/internal/_build/results?buildId=2660881&view=results ``` D:\a\_work\1\s\.dotnet\sdk\10.0.100-preview.3.25125.5\Microsoft.Common.CurrentVersion.targets(2424,5): error MSB3106: Assembly strong name "D:\a\_work\1\s\artifacts\bin\Microsoft.VisualBasic.Forms.Tests\..\System.Drawing.Facade\Release\net10.0\System.Drawing.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [D:\a\_work\1\s\src\Microsoft.VisualBasic.Forms\tests\UnitTests\Microsoft.VisualBasic.Forms.Tests.vbproj] ##[error].dotnet\sdk\10.0.100-preview.3.25125.5\Microsoft.Common.CurrentVersion.targets(2424,5): error MSB3106: (NETCORE_ENGINEERING_TELEMETRY=Build) Assembly strong name "D:\a\_work\1\s\artifacts\bin\Microsoft.VisualBasic.Forms.Tests\..\System.Drawing.Facade\Release\net10.0\System.Drawing.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). ``` * MS.VB.Forms.Tests is not testing design time scenarios, removing DT dependencies. * replaced BaseOutputPath with ArtifactsBinDir in projects * restored workaround to reference the right instance of System.Drawing facade assembly from tests
2 parents 397562b + 474d8fb commit 1a43082

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

src/Microsoft.VisualBasic.Forms/tests/UnitTests/Microsoft.VisualBasic.Forms.Tests.vbproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,10 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<ProjectReference Include="..\..\..\System.Design\src\System.Design.Facade.csproj" />
2120
<ProjectReference Include="..\..\..\System.Drawing.Common\src\System.Drawing.Common.csproj" />
22-
<ProjectReference Include="..\..\..\System.Drawing.Design\src\System.Drawing.Design.Facade.csproj" />
2321
<ProjectReference Include="..\..\..\System.Windows.Forms.Primitives\tests\TestUtilities\System.Windows.Forms.Primitives.TestUtilities.csproj" />
2422
<ProjectReference Include="..\..\..\test\util\System.Windows.Forms\System.Windows.Forms.TestUtilities.csproj" />
2523
<ProjectReference Include="..\..\src\Microsoft.VisualBasic.Forms.vbproj" />
2624
</ItemGroup>
2725

28-
<ItemGroup>
29-
<!-- workaround for https://github.com/dotnet/sdk/issues/3254 -->
30-
<Reference Include="$(BaseOutputPath)..\System.Drawing.Facade\$(Configuration)\$(SourceTargetFramework)\System.Drawing.dll" />
31-
</ItemGroup>
32-
3326
</Project>

src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<ItemGroup>
3030
<!-- workaround for https://github.com/dotnet/sdk/issues/3254 -->
31-
<Reference Include="$(BaseOutputPath)..\System.Design.Facade\$(Configuration)\$(SourceTargetFramework)\System.Design.dll" />
31+
<Reference Include="$(ArtifactsBinDir)\System.Design.Facade\$(Configuration)\$(SourceTargetFramework)\System.Design.dll" />
3232
</ItemGroup>
3333

3434
<ItemGroup>

src/System.Windows.Forms/System/Windows/Forms/DataBinding/ControlBindingsCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace System.Windows.Forms;
1010
/// Represents the collection of data bindings for a control.
1111
/// </summary>
1212
[DefaultEvent(nameof(CollectionChanged))]
13-
[Editor($"System.Drawing.Design.UITypeEditor, {(Assemblies.SystemDrawing)}", typeof(UITypeEditor))]
13+
[Editor($"System.Drawing.Design.UITypeEditor, {Assemblies.SystemDrawing}", typeof(UITypeEditor))]
1414
[TypeConverter($"System.Windows.Forms.Design.ControlBindingsConverter, {Assemblies.SystemDesign}")]
1515
public class ControlBindingsCollection : BindingsCollection
1616
{

src/test/unit/System.Windows.Forms/System.Windows.Forms.Tests.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@
3131
<ProjectReference Include="..\..\..\System.Private.Windows.Core\tests\System.Private.Windows.Core.Tests\System.Private.Windows.Core.Tests.csproj" />
3232
<ProjectReference Include="..\..\..\System.Windows.Forms\System.Windows.Forms.csproj" />
3333
<ProjectReference Include="..\..\..\System.Design\src\System.Design.Facade.csproj" />
34+
<!-- This facade assembly is required to resolve UITypeEditor type from NETFX that is referenced in EditorAttributes -->
35+
<ProjectReference Include="..\..\..\System.Drawing\src\System.Drawing.Facade.csproj" />
3436
<ProjectReference Include="..\..\..\System.Drawing.Design\src\System.Drawing.Design.Facade.csproj" />
3537
<ProjectReference Include="..\..\integration\System.Windows.Forms.IntegrationTests.Common\System.Windows.Forms.IntegrationTests.Common.csproj" />
3638
<ProjectReference Include="..\..\util\System.Windows.Forms\System.Windows.Forms.TestUtilities.csproj" />
3739
</ItemGroup>
3840

3941
<ItemGroup>
4042
<!-- workaround for https://github.com/dotnet/sdk/issues/3254 -->
41-
<Reference Include="$(BaseOutputPath)..\System.Drawing.Facade\$(Configuration)\$(SourceTargetFramework)\System.Drawing.dll" />
43+
<Reference Include="$(ArtifactsBinDir)\System.Drawing.Facade\$(Configuration)\$(SourceTargetFramework)\System.Drawing.dll" />
4244
</ItemGroup>
4345

4446
<ItemGroup>

src/test/unit/System.Windows.Forms/System/Windows/Forms/Design/DesignerAttributeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void TypeConverterAttribute_TypeExists(string subject, TypeConverterAttri
171171
[MemberData(nameof(GetAttributeOfTypeAndProperty_TestData), Assemblies.SystemWindowsForms, typeof(EditorAttribute))]
172172
public void EditorAttribute_TypeExists(string subject, EditorAttribute attribute)
173173
{
174-
var type = Type.GetType(attribute.EditorTypeName, false);
174+
var type = Type.GetType(attribute.EditorTypeName, throwOnError: false);
175175
_output.WriteLine($"{subject}: {attribute.EditorTypeName} --> {type?.Name}");
176176

177177
if (SkipList.Contains(attribute.EditorTypeName))

0 commit comments

Comments
 (0)