即使可以构建它,也无法发布ASP.NET项目

时间:2018-12-07 19:24:10

标签: c# asp.net .net web-deployment

几个小时前,我使用发布配置文件(.pubxml)很好地发布了ASP.NET项目,在.pubxml中进行细微更改后,我突然收到了1000多个错误消息,即使我可以在本地构建和运行项目。

这是.pubxml

    <?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
    <MsDeploySkipRules Include="CustomSkipFolder">
      <ObjectName>dirPath</ObjectName>
      <AbsolutePath>Temp</AbsolutePath>
    </MsDeploySkipRules>
    <MsDeploySkipRules Include="CustomSkipFolder">
      <ObjectName>dirPath</ObjectName>
      <AbsolutePath>Uploads</AbsolutePath>
    </MsDeploySkipRules>

    <!--<Content Update="TempImages/**" CopyToPublishDirectory="Never" />-->

    <MsDeploySkipRules Include="CustomSkipFolder">
      <ObjectName>dirPath</ObjectName>
      <AbsolutePath>TempImages</AbsolutePath>
    </MsDeploySkipRules>
    <MsDeploySkipRules Include="CustomSkipFile">
      <ObjectName>filePath</ObjectName>
      <AbsolutePath>Web.config</AbsolutePath>
    </MsDeploySkipRules>
    <MsDeploySkipRules Include="CustomSkipFile">
      <ObjectName>filePath</ObjectName>
      <AbsolutePath>ConfigConn.xml</AbsolutePath>
    </MsDeploySkipRules>
  </ItemGroup>
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <PrecompileBeforePublish>True</PrecompileBeforePublish>
    <EnableUpdateable>True</EnableUpdateable>
    <DebugSymbols>False</DebugSymbols>
    <WDPMergeOption>MergeAllPagesAndControlToASingleAssembly</WDPMergeOption>
    <UseMerge>True</UseMerge>
    <ContentAssemblyName>EspiaWeb_deploy</ContentAssemblyName>
    <ExcludeApp_Data>True</ExcludeApp_Data>
    <!--<ExcludeFilesFromDeployment>Web.config;ConfigConn.xml</ExcludeFilesFromDeployment>-->
    <ExcludeFoldersFromDeployment>.vs</ExcludeFoldersFromDeployment>
    <!--<ExcludeFoldersFromDeployment>.vs;Temp;Uploads;TempImages</ExcludeFoldersFromDeployment>-->
    <publishUrl>W:\Documentos\espiaupd</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>
</Project>

这些只是我收到的+1000条错误消息中的5条

LogInExterno\Web References\ReferenciaUsuario\Reference.cs(742,153): error CS0246: The type or namespace name 'ResponseNamespace' could not be found (are you missing a using directive or an assembly reference?) [W:\Axon\Proyectos\espiaWeb\espiaWeb\espiaWeb.csproj]
LogInExterno\Web References\ReferenciaUsuario\Reference.cs(742,196): error CS0246: The type or namespace name 'Use' could not be found (are you missing a using directive or an assembly reference?) [W:\Axon\Proyectos\espiaWeb\espiaWeb\espiaWeb.csproj]
LogInExterno\Web References\ReferenciaUsuario\Reference.cs(742,200): error CS0234: The type or namespace name 'Services' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) [W:\Axon\Proyectos\espiaWeb\espiaWeb\espiaWeb.csproj]
LogInExterno\Web References\ReferenciaUsuario\Reference.cs(742,256): error CS0246: The type or namespace name 'ParameterStyle' could not be found (are you missing a using directive or an assembly reference?) [W:\Axon\Proyectos\espiaWeb\espiaWeb\espiaWeb.csproj]
LogInExterno\Web References\ReferenciaUsuario\Reference.cs(742,271): error CS0234: The type or namespace name 'Services' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) [W:\Axon\Proyectos\espiaWeb\espiaWeb\espiaWeb.csproj]

1 个答案:

答案 0 :(得分:0)

如果右键单击该项目并转到“发布”,则应该能够创建新的“发布”配置文件。您还应该能够在GUI中查看旧的发布配置文件。尝试将值从旧值复制到新值吗?