.net 角度构建未在Visual Studio 2017中部署到azure
我已经在一个Angular项目上工作了一段时间,我运行Angular 5已经有一段时间了,我将项目升级到Angular 6,希望很快升级到Angular 7。当我尝试将项目发布到Azure应用程序服务时,它成功地构建了.net和angular文件。我还将.net构建部署到服务器上,但由于某些原因,它不再上传angular构建。我的csproj中没有任何更改,它直接来自VisualStudio的Angle模板 对于Angular 5,我从来没有遇到过这个问题,然后我升级到6,出现了这个问题。无法解决此问题,因此我创建了一个新项目并复制了所有文件。它工作了几天,现在又坏了。我没有对发布项目涉及的任何文件进行任何更改 这是我的csproj:.net 角度构建未在Visual Studio 2017中部署到azure,.net,angular,visual-studio,azure,.net,Angular,Visual Studio,Azure,我已经在一个Angular项目上工作了一段时间,我运行Angular 5已经有一段时间了,我将项目升级到Angular 6,希望很快升级到Angular 7。当我尝试将项目发布到Azure应用程序服务时,它成功地构建了.net和angular文件。我还将.net构建部署到服务器上,但由于某些原因,它不再上传angular构建。我的csproj中没有任何更改,它直接来自VisualStudio的Angle模板 对于Angular 5,我从来没有遇到过这个问题,然后我升级到6,出现了这个问题。无法解
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="12.1.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Sendgrid" Version="9.10.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>
<ItemGroup>
<!-- Don't publish the SPA source files, but do show them in the project files list -->
<Content Remove="$(SpaRoot)**" />
<None Remove="$(SpaRoot)**" />
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
</ItemGroup>
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
<!-- Ensure Node.js is installed -->
<Exec Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
</Target>
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build --prod" />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
<DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>%(DistFiles.Identity)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
netcoreapp2.2
真的
最新的
假的
ClientApp\
$(默认项目除外)$(SpaRoot)节点_模块\**
假的
%(DistFiles.Identity)
保存最新
路径应该是正确的,因为它在同一路径上构建角度文件,并且我可以在dist文件夹中找到构建文件
从输出文件夹中的构建中获取文件并使用ftp手动上载,当然这种行为是不需要的。我也有这个问题。虽然我还没有解决方案,但我有一个比ftp传输更快/更容易的解决方案。在visual studio中,您可以[右键单击]dist目录并直接发布它 这对我来说是一个线索