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

donet publish doesn't modify web.config when --output is above the project directory #6425

Closed
mattdwen opened this issue Jun 14, 2016 · 2 comments

Comments

@mattdwen
Copy link

Steps to reproduce

  • Create a new web app project in VS at c:\projects\webapp1
  • From the CLI, in c:\projects, run `dotnet publish .\webapp1\project.json --output .\pubtest

If you run dotnet publish --output ..\pubtest\ from inside the webapp1 directory it works fine.

Expected behavior

The published web.config to be correctly updated with the relevant parameters.

Actual behavior

web.config isn't updated, and the the CLI spits out:

Configuring the following project for use with IIS: './pubtest'
No web.config found. Creating './pubtest\web.config'
Could not find a part of the path 'C:\Projects\WebApplication1\pubtest\web.config'.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Projects\WebApplication1\pubtest\web.config'
.
    at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize,
FileOptions options, FileStream parent)
    at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSiz
e, FileOptions options, FileStream parent) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOp
tions options)
   at Microsoft.AspNetCore.Server.IISIntegration.Tools.PublishIISCommand.Run()
   at Microsoft.AspNetCore.Server.IISIntegration.Tools.Program.<>c__DisplayClass0_0.<Main>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.AspNetCore.Server.IISIntegration.Tools.Program.Main(String[] args)
publish: Published to ./pubtest

web.config looks like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
  -->

  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
    </handlers>
    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
  </system.webServer>
</configuration>

If you then publish this to Azure you get a CGI error.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
@moozzyk
Copy link
Contributor

moozzyk commented Jun 14, 2016

@mattdwen
Copy link
Author

Yeah, I'd say it's the same.

Closed as dupe.

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
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

2 participants