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

Run the MSBuildWorkspace tests on .Net Core #52064

Closed
wants to merge 7 commits into from

Conversation

JoeRobich
Copy link
Member

No description provided.

Comment on lines -17 to -20
[DllImport("Microsoft.VisualStudio.Setup.Configuration.Native.dll", ExactSpelling = true, PreserveSig = true)]
private static extern int GetSetupConfiguration(
[MarshalAs(UnmanagedType.Interface), Out] out ISetupConfiguration configuration,
IntPtr reserved);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very happy to see this going away!

}

[ConditionalFact(typeof(VisualStudioMSBuildInstalled)), Trait(Traits.Feature, Traits.Features.MSBuildWorkspace)]
public async Task TestOpenProject_WithXaml()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this run on .NET 5, at least with some variations?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried adding a test for this and the generated source files do not get added to the workspace. The compilation contains the following diagnostic.

error CS5001: Program does not contain a static 'Main' method suitable for an entry point

Perhaps the WPF on .NET core requires a particular target to be run...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what documentation says about migrating. Note the different outputtype, tfm, and Microsoft.Windows.Compatibility reference (not sure if that's needed)

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net5.0-windows</TargetFramework>
    <OutputType>WinExe</OutputType>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <UseWPF>true</UseWPF>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
    <PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.2.211942">
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.2" />
  </ItemGroup>
</Project>

src/Workspaces/MSBuildTest/VisualStudioMSBuildInstalled.cs Outdated Show resolved Hide resolved
src/Workspaces/MSBuildTest/DotNetSdkMSBuildInstalled.cs Outdated Show resolved Hide resolved
@JoeRobich
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@JoeRobich
Copy link
Member Author

This PR superseded by #57613

@JoeRobich JoeRobich closed this Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants