question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible issue with Web.Config

See original GitHub issue

Describe the bug

In the API template, both the web and test project target <Project Sdk="Microsoft.NET.Sdk.Web"> this makes them both web projects in the eyes of dotnet. When I publish, I get a Web.Config like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\MyApp.IntegrationTest.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 57839160-3C89-4A5A-BC23-A78F39551C1E-->

Emphasis on: arguments=".\MyApp.IntegrationTest.dll"

To Reproduce

Create a template with integration tests, publish, check Web.Config, it might produce one like the above. It did for my anyway.

Project template

API

Possible Solutions

  • Be more explicit about which project to publish in CAKE.
  • <IsPackable>false</IsPackable> and <IsPublishable>false</IsPublishable>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RehanSaeedcommented, Nov 2, 2020

As far as publishing goes if you are running the Publish task in the cake script, I see your point. It’s currently publishing all projects in the solution. There are two ways to solve this problem:

  1. In the cake scripts publish step, only publish projects in the /Source subdirectory.
  2. Add <IsPublishable>false</IsPublishable> to the integration test.

I’m leaning towards the first one. Does that solve your issue or have I missed something?

0reactions
favianncommented, Nov 11, 2020

It did fix the issue. Thanks! (Sorry for the late answer)

Read more comments on GitHub >

github_iconTop Results From Across the Web

iis - Web Application Problems (web.config errors) HTTP ...
This error is related to web.config file. When web.config is not proper or using some features which is not available in IIS, then...
Read more >
How can you verify if you have any issues with your web ...
2 answers · Look for the line number of the error in the web.config validator report or the text editor with syntax highlighting....
Read more >
HTTP Error 500.19 on Internet Information Services (IIS) ...
This problem occurs because the ApplicationHost.config or Web.config file contains a malformed or unidentified XML element.
Read more >
web.config error in IIS, so could not open Handlers Maping
But it shows error in web.config file. I done all the possible ways to resolve the issue. But couldn't any solution.
Read more >
How to Use Web.Config customErrors in ASP.Net
Read ways to track, find, and view app errors in the Web.Config customErrors section in ASP.NET framework. Use Retrace to log all ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found