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

Auto added aspnetcore handler and "module" #72

Open
NikolaSivkov opened this issue Nov 21, 2023 · 2 comments
Open

Auto added aspnetcore handler and "module" #72

NikolaSivkov opened this issue Nov 21, 2023 · 2 comments

Comments

@NikolaSivkov
Copy link

Let me start by saying that this project is a godsent!
Thank you for your work and effort on this!

While upgrading asp.net mvc 5 project the following lines got added to the project, possibly by VS 2022's code, possibly by this SDK, i'm not certain, unfortunately.

image

After my project failing to start at all, and just crashing, i found the culprit were those 2 lines.

After removing them, my project just works!
And since i'm not sure if the 2 lines were added by this SDK or not, i'm posting here, and maybe it can be added to the docs, so others can save themselves some debugging time :)

@CZEMacLeod
Copy link
Owner

Not added by this sdk.
Might have been VS.
Or depending on how you converted the project and created your launchsettings that might have done it.

@leusbj
Copy link
Contributor

leusbj commented Mar 19, 2024

I have seen these items get added to the web.config before as well.

I'm pretty sure that it is happening because of a combination of 3 factors:

  • The <ProjectCapability Include="DotNetCoreWeb" /> which allows this SDK to use the modern launchsettings.json
  • Visual Studio's attempt to be helpful by creating these for ASPNet core apps, since these items are basically needed for ASPNet core apps to run in IIS/IISExpress,
  • A few specific versions of VisualStudio (several versions of VS 2017, and at least one version of 2019) appear incapable of detecting which version of .net the IIS application pool should be running under... meaning it thinks it is supposed to be an ASPNET core app instead of seeing it should be .Net Framework, and so it adds those entries

@CZEMacLeod

I know that the DotNetCoreWeb ProjectCapability provides many nice-to-haves

  • project automatically creates launchsettings.json if not exists
  • VS knows that it needs to create an ApplicationHost.config (IIS Express config) file in a "system" folder in the solution directory
  • VS knows to configure appropriate "sitename" and physical path properties in the ApplicationHost.config
  • Plugs the different launch profiles into the scaffolding to make launching easy.

Do you have any desire to investigate what the SDK might need look like if it did not take advantage of the DotNetCoreWeb capability

  • Point the RunCommand at IISExpress.exe and pass some arguments to allow launching IISExpress when "Start Debug" is selected?
  • Use some XMLPeek/XmlPoke/TransformXML (or potentially C# built to dll) to mimic the ability to ensure the ApplicationHost.config in the solution directory
  • Others?

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

No branches or pull requests

3 participants