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

Move some targets into a Directory.Build.targets file #39712

Merged
merged 3 commits into from
Jan 25, 2022

Conversation

dougbu
Copy link
Member

@dougbu dougbu commented Jan 23, 2022

  • not used outside IIS testassets/ folder

nits:

  • remove / update outdated comments
  • use $(DotNetRoot) property

@ghost ghost added the area-runtime label Jan 23, 2022
@dougbu dougbu force-pushed the dougbu/remove.iis.override branch 2 times, most recently from c32b6ae to eada1f5 Compare January 23, 2022 22:22
@dougbu dougbu changed the title !trial! Try using regular artifacts/bin/ folder Use regular artifacts/bin/ folder for IIS projects Jan 23, 2022
@dougbu dougbu changed the title Use regular artifacts/bin/ folder for IIS projects Use regular artifacts/bin/ folders for IIS projects Jan 23, 2022
@dougbu dougbu force-pushed the dougbu/remove.iis.override branch from eada1f5 to d1678d5 Compare January 23, 2022 22:23
@dougbu dougbu requested review from a team and adityamandaleeka January 23, 2022 22:25
@dougbu
Copy link
Member Author

dougbu commented Jan 23, 2022

@adityamandaleeka could you find a reviewer for this quick fix please❔

@dougbu
Copy link
Member Author

dougbu commented Jan 23, 2022

/btw the bottom line here is an attempt to make the IIS projects slightly less unusual

@dougbu dougbu force-pushed the dougbu/remove.iis.override branch 4 times, most recently from ace2ddc to 9b5b80f Compare January 24, 2022 02:43
@dougbu dougbu marked this pull request as ready for review January 24, 2022 05:02
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" />

<PropertyGroup>
<!-- Work around until we get a new WebSdk -->
Copy link
Member

Choose a reason for hiding this comment

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

@Tratcher any context about what this workaround comment is talking about?

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 wondered about this too❕

Copy link
Member

Choose a reason for hiding this comment

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

LOL, no, but it happened back in 3.0 so it's probably safe to say we got a fresh WebSdk update since then 😁.
dougbu@a474a05

Copy link
Member Author

Choose a reason for hiding this comment

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

The current default (in Microsoft.NET.Sdk.Web.ProjectSystem.targets) is inprocess and this override may make sense still. Let's use this space to answer

  1. Should we update InProcessNewShimWebSite.csproj and InProcessWebSite.csproj instead of leaving this setting here❔
  2. Did I break anything by effectively removing this setting from NativeIISSample.csproj and ServerComparison.TestSites.csproj❔
  3. Does the setting have any impact in projects that import testsite.props but don't use Microsoft.NET.Sdk.Web
  4. What are the best hosting models for each of the affected projects❔

Copy link
Member Author

Choose a reason for hiding this comment

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

On (1), I suspect (given the names), the current setting is unhelpful for both InProcess*WebSite projects. Suggest we simply delete these lines and focus on the other projects.

On (2), "break" is probably too strong a word but I did change things. Good thing tests are still working.

Copy link
Member

@HaoK HaoK 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 assuming you tried running the tests locally (dotnet test) and in VS test explorer (note make sure you run in an administrator powershell)

@dougbu
Copy link
Member Author

dougbu commented Jan 24, 2022

assuming you tried running the tests locally (dotnet test) and in VS test explorer (note make sure you run in an administrator powershell)

I am unable to test locally even on main and can't find instructions about which IIS components I may be missing. Suggestions❔

In the meantime, I'll see whether the IIS Express functional tests work better for me.

@HaoK
Copy link
Member

HaoK commented Jan 24, 2022

You'll need regular IIS enabled, I think you just will need to make sure IIS is installed/enabled, and have the hosting bundle, https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-6.0 might be a good verification, basically make sure you can publish to IIS in VS and that is what the tests need to work

- tests have for a while worked only after `publish` anyhow

nits:
- remove outdated comment
- use `$(DotNetRoot)` property
- not used outside IIS testassets folder
- this reverts some of commit 4bb1920bfa4f
- leave nits alone
@dougbu dougbu force-pushed the dougbu/remove.iis.override branch from 9b5b80f to 20414d6 Compare January 24, 2022 22:20
@dougbu
Copy link
Member Author

dougbu commented Jan 24, 2022

I reverted the <BaseOutputPath/> / <OutputPath/> part, meaning this PR mostly moves the test asset-only targets into the new Directory.Build.targets file. Main issue was the deployers make a lot of assumptions about where bin/ folders are in local tests and the output paths were still changed in src/DefaultBuilder/, src/Hosting, and other parts of src/Servers/. We might be able to remove most of those Arcade overrides, but I wasn't ready to change the deployer expectations.

@dougbu dougbu changed the title Use regular artifacts/bin/ folders for IIS projects Move some targets into a Directory.Build.targets file Jan 24, 2022
<Import Project="..\..\..\..\build\testsite.props" />

<PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<AssemblyName>InProcessWebSite</AssemblyName>
<TestAssetOutputName>InProcessNewShimWebSite</TestAssetOutputName>
Copy link
Member Author

Choose a reason for hiding this comment

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

Another nit: Setting matches the default.

@@ -2,7 +2,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<!-- Local testing does not work when bin/ directory is not in project directory due to deployer expectations. -->
Copy link
Member Author

Choose a reason for hiding this comment

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

nit: I don't think this was about "test content". Problem seems rooted in the various deployers.

@dougbu
Copy link
Member Author

dougbu commented Jan 24, 2022

Well, even w/ IIS Express installed and much of the previous change reverted, Microsoft.AspNetCore.Server.IIS.IISExpress.FunctionalTests.InProcess.MaxRequestBodySizeTests.SetIISLimitMaxRequestBodyLogsWarning failed and more tests were skipped (159) than passed (147).

I'd like to try IIS but obviously don't have all the components I need. Trying a complete removal of the "Internet Information Services" fix, removing the hosting bundle, and rebooting before a retry…

@dougbu
Copy link
Member Author

dougbu commented Jan 25, 2022

I'd like to try IIS but obviously don't have all the components I need. Trying a complete removal of the "Internet Information Services" fix, removing the hosting bundle, and rebooting before a retry…

This didn't help much. Getting errors like Xunit.Sdk.XunitException: Could not find aspnetcorev2_inprocess.dll loaded in process w3wp and lots of Internal Server Errors. While many of the IIS tests appear to be Helix-only (probably because the deployers aren't consistent about handling the local testing case), IIS.FunctionalTests failed (rather than skipped) 135 tests. Is there a non-default component I need❔

My leaning is toward giving up on local testing unless using IIS Express until and unless I decide to take another crack at finally migrating these tests to understand artifacts/bin/.

Any reason not to merge this PR in the meantime❔

@HaoK
Copy link
Member

HaoK commented Jan 25, 2022

I wouldn't worry too much about getting IIS working as long as some IISExpress tests were working for you locally with your change. Its fine if you merge this as is, if things are completely broken locally for me after picking up this PR, I'll fix/revert at that point

@dougbu dougbu merged commit 209ff13 into dotnet:main Jan 25, 2022
@dougbu dougbu deleted the dougbu/remove.iis.override branch January 25, 2022 17:46
@ghost ghost added this to the 7.0-preview1 milestone Jan 25, 2022
@wtgodbe wtgodbe modified the milestones: 7.0-preview1, 7.0-preview2 Jan 31, 2022
HaoK added a commit that referenced this pull request Feb 23, 2022
HaoK added a commit that referenced this pull request Feb 24, 2022
Revert "Move some targets into a Directory.Build.targets file (#39712)"

This reverts commit 209ff13.

Bring back directory build

Revert "Revert fx_ver rename and use aspnet namespace"

This reverts commit d9c3d28.

Revert "Revert "Revert fx_ver rename and use aspnet namespace""

This reverts commit e2b34b88cde041b9e4bf1137eb4c07b9788b2232.

Revert "Bring back directory build"

This reverts commit ad9007e3ef6b7fce1c3677aa8cfa891c23fea32e.

Revert "Revert "Move some targets into a Directory.Build.targets file (#39712)""

This reverts commit e7937bc.
HaoK added a commit that referenced this pull request Feb 27, 2022
Minor cleanup

More Cleanup/CommonLibTests

Move more settings into Common.Settings

More build cleanup

Revert stuff

Revert "Revert stuff"

This reverts commit 7faa512f84631f7ef7588e498c6a70c62c8ea350.

Undo -nobuild changes to iis tests to fix running tests locally

Revert "Move some targets into a Directory.Build.targets file (#39712)"

This reverts commit 209ff13.

Bring back directory build

Revert "Revert fx_ver rename and use aspnet namespace"

This reverts commit d9c3d28.

Revert "Revert "Revert fx_ver rename and use aspnet namespace""

This reverts commit e2b34b88cde041b9e4bf1137eb4c07b9788b2232.

Revert "Bring back directory build"

This reverts commit ad9007e3ef6b7fce1c3677aa8cfa891c23fea32e.

Revert "Revert "Move some targets into a Directory.Build.targets file (#39712)""

This reverts commit e7937bc.

Unskip some more local tests
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants