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

Add some msbuild magic to deploy dependent ASP.NET Core app #3

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

twsouthwick
Copy link

This change adds some targets that will publish the .NET Core app and copy the contents to the legacy output directory. This will also update the web.config to ensure the path/hosting model is correct.

@@ -22,7 +22,6 @@
<add name="Pages" path="*.aspx" verb="*" type="System.Web.Handlers.TransferRequestHandler" modules="AspNetCoreModuleV2" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" modules="AspNetCoreModuleV2" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<aspNetCore processPath="dotnet" arguments="..\Greenfield\bin\Debug\netcoreapp3.1\Greenfield.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="outofprocess" />
Copy link
Owner

Choose a reason for hiding this comment

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

Doesn't this break running in VS?

Copy link

Choose a reason for hiding this comment

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

We can do some transform/msbuild stuff here to cause the right config to happen in the end, can't we?

Copy link
Owner

@davidfowl davidfowl Oct 8, 2021

Choose a reason for hiding this comment

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

Not sure, it needs to work "in-place" without a publish.

Copy link

Choose a reason for hiding this comment

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

We can always make this file development.web.config and convert it into web.config as part of the build with the right stuff on it.

Copy link
Owner

Choose a reason for hiding this comment

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

Remember web.config is in source control. So the goal is to avoid physical paths in this file.

Copy link
Author

@twsouthwick twsouthwick Oct 11, 2021

Choose a reason for hiding this comment

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

at the moment it's editing in place. Can totally change it to another path. It keeps all the paths relative.

It's using an xml transform to remove the node and add it with the correct pathing

Copy link
Author

Choose a reason for hiding this comment

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

We could also update it to handle any of the extensions in the static output that we want to let through

Copy link
Owner

Choose a reason for hiding this comment

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

The problem is the user might have made changes to web.config and we'll blast it away

Copy link
Author

Choose a reason for hiding this comment

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

Are you referring to the aspNetCore node? That's the only one it'll affect (at the moment). It seems like moving that to build-generated would be best since then we can update paths/etc. I can disable the web.config transform so this PR just focuses on getting things published.

Copy link
Author

Choose a reason for hiding this comment

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

I pushed a change with what the web.config changes look like (the TransformXml task messes with whitespace :(). I like what @javiercn said about dev.web.config. Not sure how to include that, though (is that auto-included as part of the build process?)

@@ -5,54 +5,59 @@
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
Copy link
Owner

Choose a reason for hiding this comment

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

Triggered! 😄

LegacyApi/Web.config Outdated Show resolved Hide resolved
twsouthwick and others added 2 commits October 11, 2021 11:08
Co-authored-by: David Fowler <davidfowl@gmail.com>
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.

None yet

3 participants