【发布时间】:2019-04-19 22:29:13
【问题描述】:
情况就是这样,我能够通过 Visual Studio 2018 FTP 发布选项成功地将我的应用程序实时发布到 Web 主机,并且它可以正确连接和发布它,并且更改是可见的。
但是,服务器上存储了一些文件夹,其中包含多个音频文件,因此每次我发布音频文件时都会删除并重新发布。不仅过程太长,而且是多余的。而且由于 ASP.NET Core 将应用程序转换为 dll 文件,因此在客户端更快,但发布更改是一场噩梦,因为必须删除所有文件,包括音频文件夹并重新上传。
csproj 文件如下所示:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Content Remove="Views\Shared\ExplainPage.cshtml" />
</ItemGroup>
<ItemGroup>
<None Remove="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Remove="Properties\PublishProfiles\CustomProfile1.pubxml" />
<None Remove="Properties\PublishProfiles\umaraftab.net - Web Deploy.pubxml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation" Version="2.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\PublishProfiles\" />
<Folder Include="wwwroot\explanations\" />
<Folder Include="wwwroot\lectures\" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\slick\fonts\slick.svg" />
</ItemGroup>
</Project>
wwwroot\lectures 和 wwwroot\explanation 文件夹包含音频文件。 任何人都可以建议我如何让音频文件夹保持原样在服务器上并重新创建 dll 文件并上传它们,因为这就是更改所在。
问候,
【问题讨论】:
标签: c# asp.net asp.net-core-mvc