Skip to content
This repository was archived by the owner on Oct 18, 2018. It is now read-only.

fix build by adding OutputType exe to test project #179

Merged
merged 2 commits into from
May 25, 2017
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>

<!--
Workaround for "Explicit RID still required for .NET Framework test projects" (https://github.com/dotnet/sdk/issues/909).
Remove when fixed.
-->
<OutputType>exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
20 changes: 20 additions & 0 deletions test/Microsoft.AspNetCore.WebSockets.Test/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

#if NET461
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasn't able to quickly track down how we fixed this before. In netcoreapp2.0 the Test SDK brings a dummy Program.Main, but in net461 we need one to make the compiler happy (because of <OutputType>exe</>), thus the #if

Copy link
Contributor

Choose a reason for hiding this comment

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

Copyright still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that we have a green build, I'll just add that as I merge.

using System;

namespace Microsoft.AspNetCore.WebSockets.Test
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("This Program.Main is only here to work around https://github.com/dotnet/sdk/issues/909");
}
}
}
#elif NETCOREAPP2_0
#else
#error Target frameworks need to be updated
#endif