Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Upgrade to VS 2017 #194

Merged
merged 10 commits into from
Feb 7, 2017
Merged

Upgrade to VS 2017 #194

merged 10 commits into from
Feb 7, 2017

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Feb 3, 2017

Issues:

TODO:

  • Tag helper tests are failing Resolved.
Failed   EntropyTests.TagHelperSampleTest.MoviesController_Pages_ReturnSuccess(requestPages: Func`2 { Method = System.Threading.Tasks.Task`1[System.Collections.Generic.IEnumerable`1[System.Net.Http.HttpResponseMessage]] <get_MoviesControllerPageData>b__12_0(System.Net.Http.HttpClient), Target = <>c { } })
Error Message:
 Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException : One or more compilation failures occurred:
Error @ (612:11,80)(30) - [The assembly 'Microsoft.AspNetCore.Mvc.Razor' could not be resolved or contains no tag helpers.] (11,80) The assembly 'Microsoft.AspNetCore.Mvc.Razor' could not be resolved or contains no tag helpers.
Error @ (17:0,17)(35) - [The assembly 'Microsoft.AspNetCore.Mvc.TagHelpers' could not be resolved or contains no tag helpers.] (0,17) The assembly 'Microsoft.AspNetCore.Mvc.TagHelpers' could not be resolved or contains no tag helpers.

The test app that is being run builds, publishes, and runs just fine.

Any ideas @NTaylorMullen ?

Resolves #193

@dnfclas
Copy link

dnfclas commented Feb 3, 2017

Hi @natemcmaster, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@NTaylorMullen
Copy link
Contributor

Any ideas @NTaylorMullen ?

Is that only failing on desktop?

@natemcmaster
Copy link
Contributor Author

Actually, the entire .NET Core test run is failing:

Test run for C:\projects\entropy\test\FunctionalTests\bin\Debug\netcoreapp1.1\FunctionalTests.dll(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Warning: No test is available in C:\projects\entropy\test\FunctionalTests\bin\Debug\netcoreapp1.1\FunctionalTests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

The error I mentioned is only desktop...as far as I can tell

@NTaylorMullen
Copy link
Contributor

Try disabling shadow copy on test runs. The TagHelper Assembly.Load is probably failing due to it.

@natemcmaster
Copy link
Contributor Author

I tried that. Still fails 😕

@NTaylorMullen
Copy link
Contributor

Actually, the entire .NET Core test run is failing:

Grab the latest vstest bits and update your host locally. It'll split out more information as to why it's failing to find tests.

@natemcmaster
Copy link
Contributor Author

I have all but 16 tests passing now. On both .NET Framework and .NET Core, all failing tests have this error:

CompilationFailedException : One or more compilation failures occurred:
Error @ (612:11,80)(30) - [The assembly 'Microsoft.AspNetCore.Mvc.Razor' could not be resolved or contains no tag helpers.] (11,80) The assembly 'Microsoft.AspNetCore.Mvc.Razor' could not be resolved or contains no tag helpers.

@NTaylorMullen
Copy link
Contributor

Did it pass in project.json land? I'm curious if @rynowak's recent conversion to use new Razor caused this.

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Feb 4, 2017

Yes, it passes in project.json. Does razor rely on Assembly.GetEntryAssembly to locate anything? This is one of the things that changed with xunit.runner.visualstudio from dotnet-test-xunit

@NTaylorMullen
Copy link
Contributor

I believe we indirectly depend on it via DependencyContext; however, didn't old world also mess up GetEntryAssembly too?

I'm not familiar with how Entropy runs their tests but if it's anything like MVC you may need to do the following to ensure DependencyContext.Load works: https://github.com/aspnet/Mvc/pull/5749/files#diff-c611e174495fa124b795bc0138d9bf50R52

@natemcmaster
Copy link
Contributor Author

Brilliant! That little target to copy deps files fixed it. I'll add to these functional tests. Do you have an issue tracking the issue the removal of this workaround?

@natemcmaster natemcmaster changed the title wip: Upgrade to VS 2017 Upgrade to VS 2017 Feb 4, 2017
@natemcmaster
Copy link
Contributor Author

Remove wip label. Should be ready to merge now.

@NTaylorMullen
Copy link
Contributor

Brilliant! That little target to copy deps files fixed it. I'll add to these functional tests. Do you have an issue tracking the issue the removal of this workaround?

Not a workaround. It was a by design break. Before it would embed the deps.json in each of the dependent dll's so DependencyContext.Load would just work; now it places the deps.json next to the dll in its own output dir (which is why we need to copy them over).

@natemcmaster
Copy link
Contributor Author

Oh. How many people are actually doing functional tests with razor? Won't they all hit this now?

Nate McMaster added 4 commits February 3, 2017 17:06
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Contributor

Choose a reason for hiding this comment

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

Not Sdk.Web?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's at actually not a web project. It only has web.config because it's showing how to use configuration to read xml.

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto question about the sdk.web. Mostly just asking because of the Content include on web.config

@@ -0,0 +1 @@
wwwroot/lib/
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious: Why'd need to be added in the new world?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nothing changed. I was just tired of seeing a bunch of files installed from bower as pending changes in git.

</PropertyGroup>

<ItemGroup>
<Content Update="wwwroot\**\*;Views\**\*;appsettings.json;web.config" CopyToOutputDirectory="PreserveNewest" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove 😄

</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0-msbuild3-final" />
Copy link
Contributor

Choose a reason for hiding this comment

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

version

</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="resources\*.*" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Need the excludes?

<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
<DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants>
<!-- set explicitly because some tests depend on this -->
<RootNamespace>FunctionalTests</RootNamespace>
Copy link
Contributor

Choose a reason for hiding this comment

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

O_o?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Affects the name of the embedded resources.

private readonly string _categoryName;

public XunitLogger(ITestOutputHelper output, string categoryName)
{;
Copy link
Contributor

Choose a reason for hiding this comment

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

lawl semi-colon


namespace EntropyTests
{
public class XunitLogger : ILogger, IDisposable
Copy link
Contributor

Choose a reason for hiding this comment

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

This might not be needed with the latest XUnit. They're much more verbose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still helps us a lot because the tests that deploy a server produce lots of console output. It's better to have this captured by xunit since console.writeline interleaves different tests.


namespace EntropyTests
{
class XunitLoggerProvider : ILoggerProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

public is your friend

@NTaylorMullen
Copy link
Contributor

Oh. How many people are actually doing functional tests with razor? Won't they all hit this now?

Yup, it's an odd way to do it though. We're taking a dependency on sample apps and then testing them in memory instead of individually publishing them in their own context.

@natemcmaster
Copy link
Contributor Author

natemcmaster commented Feb 4, 2017

⌚️ on breaking changes from localization to make it through CI

@natemcmaster
Copy link
Contributor Author

Passes locally, not on CI for reasons I don't understand. Will check again on Monday.

<ItemGroup>
<EmbeddedResource Include="resources\**\*" />
<Content Include="nginx.conf" CopyToOutputDirectory="PreserveNewest" />
<None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to know about this guy. I didn't 😄

@natemcmaster
Copy link
Contributor Author

Finally passing on Windows.

screen shot 2017-02-06 at 12 52 44 pm

@natemcmaster
Copy link
Contributor Author

🔔 tests passing, ready to merge.

@NTaylorMullen
Copy link
Contributor

As long as its usable in VS. :shipit:

@natemcmaster natemcmaster merged commit d367424 into dev Feb 7, 2017
@natemcmaster natemcmaster deleted the namc/vs2017 branch February 7, 2017 02:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants