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

Publishing to local folder results in a different folder/file structure than old style project #85

Open
rgozim opened this issue Oct 14, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists known limitation This issue is related to a known limitation and cannot currently be fixed.

Comments

@rgozim
Copy link

rgozim commented Oct 14, 2024

For this experiment, I created a templated WebApi project from Visual Studio for the classic .NET Framework and modified the .csproj file to contain the minimal following:

<Project Sdk="MSBuild.SDK.SystemWeb/4.0.93">
  <PropertyGroup>
      <AssemblyTitle>WebApplication1</AssemblyTitle>
      <TargetFramework>net481</TargetFramework>
      <Configurations>Debug;Release</Configurations>
      <Platforms>AnyCPU;x64;ARM64</Platforms>
      <OutputPath>bin\</OutputPath>
  </PropertyGroup>
    <ItemGroup>
        <None Include="Properties\launchSettings.json" />
    </ItemGroup>
    <ItemGroup>
      <PackageReference Include="Microsoft.AspNet.Mvc" Version="5.3.0" />
      <PackageReference Include="Microsoft.AspNet.Web.Optimization" Version="1.1.3" />
      <PackageReference Include="Microsoft.AspNet.WebApi" Version="5.3.0" />
    </ItemGroup>
    <ItemGroup>
      <Reference Include="Microsoft.CSharp" />
      <Reference Include="System.ComponentModel.DataAnnotations" />
    </ItemGroup>
</Project>

The web application compiles fine, however when publishing the output is different from that of the classic project. In the classic project the published output includes web.config and various files and folders

image

In the MSBuild.SDK.SystemWeb publish the output looks like this:

image

@CZEMacLeod
Copy link
Owner

Publish from within visual studio is not supported - as this must use the web publish method instead of the standard publish for apps.
I don't know any way to 'trick' VS to including the webpublish options instead of the 'standard' options.
More information can be found in #12
I suggest using a batch file to publish and run the msbuild command.

@CZEMacLeod CZEMacLeod added duplicate This issue or pull request already exists known limitation This issue is related to a known limitation and cannot currently be fixed. labels Oct 24, 2024
@CZEMacLeod
Copy link
Owner

@rgozim Have you tried the suggestions above? If this workaround works for you, can you close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists known limitation This issue is related to a known limitation and cannot currently be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants