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

Migrate classic .NET projects to new project structure #98

Merged
merged 7 commits into from
Dec 31, 2017

Conversation

eiriktsarpalis
Copy link
Member

This PR moves any outstanding legacy *proj files to the new project structure.

Copy link
Contributor

@ctaggart ctaggart left a comment

Choose a reason for hiding this comment

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

Looks good. Then you can get rid of the other project file by switching to <TargetFrameworks>netstandard2.0;net40</TargetFrameworks>. The only issue is VS 2017 debugging. C# picks the first framework listed to debug against by default. F# doesn't work too well in 15.5. dotnet/fsharp#4084

@ctaggart
Copy link
Contributor

Ah, the Travis CI builds are failing:

/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1122,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [/home/travis/build/fsprojects/Argu/tests/Argu.Tests/Argu.Tests.fsproj]

I'll find the link to tell dotnet to use mono to build net461.

@ctaggart
Copy link
Contributor

So it sounds like you can just call msbuild /t:build instead of dotnet build to make it work. dotnet/sdk#335

@eiriktsarpalis
Copy link
Member Author

Actually, it looks like it's testing that fails. Think it might be an xunit issue?

@ctaggart
Copy link
Contributor

Yeah, you are right. I wonder if there is a way to limit the tests to just netstandard on Travis.
microsoft/vstest#326

@ctaggart
Copy link
Contributor

Yeah, until they fix that issue, you'd have to run the net461 tests another way on Unix. You can use the dotnet test on Windows with all the frameworks and then with just network on Unix.

DotNetCli.Test (fun c -> { c with Project = proj; Framework = "netcoreapp2.0" })

if EnvironmentHelper.isWindows then
    DotNetCli.Test (fun c -> { c with Project = proj; Framework = "net461" })

You will have to combine the unit test project into one or specify them separately.

@ctaggart
Copy link
Contributor

I was hoping that was going to work. In one of my projects, I still have to call the console runner on Unix.

mono $HOME/.nuget/packages/xunit.runner.console/2.3.1/tools/net452/xunit.console.exe ./UnitTest/bin/Release/net46/UnitTest.dll

@eiriktsarpalis eiriktsarpalis merged commit b69715c into master Dec 31, 2017
@eiriktsarpalis eiriktsarpalis deleted the migrate-proj branch July 28, 2020 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants