File tree Expand file tree Collapse file tree
src/ElectronNET.IntegrationTests/Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,14 +59,13 @@ await File.WriteAllTextAsync(
5959
6060 // Create a minimal csproj that only imports the migration checks targets.
6161 // We deliberately import just that one targets file to keep the build fast.
62+ // Note: MSBuildProjectDirectory is a reserved MSBuild property — it must not be
63+ // redefined manually. MSBuild sets it automatically to the csproj's folder (tempDir).
6264 var targetsPathEscaped = TargetsFilePath . Replace ( "'" , "'" ) ;
6365 await File . WriteAllTextAsync (
6466 Path . Combine ( tempDir , "TestApp.csproj" ) ,
6567 $ """
6668 <Project>
67- <PropertyGroup>
68- <MSBuildProjectDirectory>{ tempDir } </MSBuildProjectDirectory>
69- </PropertyGroup>
7069 <Import Project="{ targetsPathEscaped } " />
7170 <Target Name="Build" DependsOnTargets="ElectronMigrationChecks" />
7271 </Project>
@@ -75,7 +74,10 @@ await File.WriteAllTextAsync(
7574 // ACT — run the Build target
7675 var ( exitCode , output ) = await RunDotnetBuildAsync ( tempDir ) ;
7776
78- // ASSERT — the build must not produce the MSB4185 "unavailable function" error
77+ // ASSERT — the build must succeed and must not produce MSB4185
78+ exitCode . Should ( ) . Be ( 0 ,
79+ $ "the temporary MSBuild project should build successfully. Full build output:\n { output } ") ;
80+
7981 output . Should ( ) . NotContain (
8082 "MSB4185" ,
8183 $ "ReadAllLines must not be used as an MSBuild property function. " +
You can’t perform that action at this time.
0 commit comments