locked
publishing targets looking for wrong Web.config full name RRS feed

  • Question

  • User-449376619 posted

    Hi,

    I am trying to publish a WCF service on my local machine in a folder. I am getting the below error when I try to publish - 

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(1482,5): Error : Could not open Source file: Could not find file 'C:\XXXX\Api\Api\Web.config;web.config'.

    The config is present without the additional web.config at the end - 'C:\XXXX\Api\Api\Web.config;'.

    Does anyone has any clue why is the config name not fetching correctly?

    Thanks,

    Rohan

    Thursday, August 29, 2019 9:34 AM

All replies

  • User665608656 posted

    Hi rohandm,

    According to your error message, you can follow the following steps to troubleshooting the issue.

    First, you should unload your project first :

    Then right click your project and choose Edit xxx.csproj:

    Then it will show this file xxx.csproj and you can find the content tag in ItemGroup, verify that the content include is written by web.config.

    I guess your content include written 'Web.config;web.config'. If so , you should change it as 'Web.config', then publish again.

    Best Regards,

    YongQing.

    Friday, August 30, 2019 9:16 AM
  • User-449376619 posted

    Thanks YongQing. I had checked for ;webconfig in project file and config tranformations already. I did not find it anywhere.

    Below is the settings-

    <ItemGroup>
    <Content Include="Concrete\Service\ScanningService.svc" />
    <Content Include="Global.asax" />
    <Content Include="log4net.xml" />
    <Content Include="Web.config">
    <SubType>Designer</SubType>
    </Content>
    </ItemGroup>

    Friday, August 30, 2019 9:44 AM
  • User665608656 posted

    Hi rohandm,

    According to your description, you can try right-clicking on the project and select the properties option.

    Then you can click the Build Events option to see if there is anything in it, and if so, delete it and publish it again.

    Best Regards,

    YongQing.

    Monday, September 2, 2019 9:53 AM
  • User-449376619 posted

    Nothing in there. Its empty.

    Tuesday, September 3, 2019 5:12 AM
  • User665608656 posted

    Hi rohandm,

    According to your project path :

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\Web\Microsoft.Web.Publishing.targets(1482,5): Error : Could not open Source file: Could not find file 'C:\XXXX\Api\Api\Web.config;web.config'.

    I hope you can provide us with your Microsoft.Web.Publishing.targets file content, which may contain some questions.

    Or you can use Web.config;web.config as a keyword to search your entire project to see if any files contain this content, and if so, change it to Web.config.

    Best Regards,

    YongQing.

    Wednesday, September 4, 2019 6:22 AM