Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 生成成功,但发布失败_Asp.net_Visual Studio 2010_Iis 7.5_Publish_Msbuild Wpp - Fatal编程技术网

Asp.net 生成成功,但发布失败

Asp.net 生成成功,但发布失败,asp.net,visual-studio-2010,iis-7.5,publish,msbuild-wpp,Asp.net,Visual Studio 2010,Iis 7.5,Publish,Msbuild Wpp,直到两天前,我还能够通过右键单击我的项目并单击上下文菜单上的“发布”按钮来使用VisualStudio2010的“发布Web”选项。现在,当我尝试做同样的事情时,我得到以下输出: ------ Build started: Project: ELMS, Configuration: Debug Any CPU ------ Build started 8/1/2011 3:08:03 PM. GenerateTargetFrameworkMonikerAttribute: Skipping ta

直到两天前,我还能够通过右键单击我的项目并单击上下文菜单上的“发布”按钮来使用VisualStudio2010的“发布Web”选项。现在,当我尝试做同样的事情时,我得到以下输出:

------ Build started: Project: ELMS, Configuration: Debug Any CPU ------
Build started 8/1/2011 3:08:03 PM.
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are
up-to-date with respect to the input files.
_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
Copying file from "C:\SVN\TrakNet\trunk\MTS\lib\Newtonsoft.Json.Net35.dll" to 
  "bin\lib\Newtonsoft.Json.Net35.dll".
CopyFilesToOutputDirectory:
  LMS -> C:\SVN\TrakNet\trunk\MTS\bin\LMS.dll

Build succeeded.

Time Elapsed 00:00:00.04
------ Publish started: Project: LMS, Configuration: Debug Any CPU ------
Object reference not set to an instance of an object.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
这是在尝试发布到本地主机时发生的(用于调试目的)

以下是我正在使用的发布配置文件的设置:

Publish Method: Web Deploy
Service URL: localhost
Site/application: default web site/ELMS
[x] Mark as IIS application on destination
[x] Leave extra files on destination (do not delete)
我已经尝试:

- Cleaning/rebuilding the project
- Deleting the bin folder of the project
- Running reg_iis.exe -i
- Reinstalling VS2010
但我所做的任何更改都无法修复错误

如能深入了解问题的原因,我们将不胜感激:)

编辑:

在我上次重新启动时,问题实际上自行解决了。自从问题首次出现以来,我必须重新启动6-7次,但这次没有对象引用消息。以下是立即生成/发布的日志:

------ Build started: Project: LMS, Configuration: Debug Any CPU ------
Build started 8/3/2011 9:10:12 AM.
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
_CopyOutOfDateSourceItemsToOutputDirectoryAlways:
  Copying file from "C:\SVN\TrakNet\trunk\MTS\lib\Newtonsoft.Json.Net35.dll" to "bin\lib\Newtonsoft.Json.Net35.dll".
CopyFilesToOutputDirectory:
  LMS -> C:\SVN\TrakNet\trunk\MTS\bin\LMS.dll

Build succeeded.

Time Elapsed 00:00:00.04
------ Publish started: Project: LMS, Configuration: Debug Any CPU ------
Gather all files from Project items @(IntermediateAssembly). Adding:
bin\LMS.dll to bin\LMS.dll
bin\LMS.pdb to bin\LMS.pdb
Gather all files from Project items @(Content). Adding:
Global.asax;lib\Newtonsoft.Json.Net35.dll;MtsSchemas\MtsSchema.xml;Web.config
Gather all files from Project output (IntermediateSatelliteAssembliesWithTargetPath).
Adding:
Gather all files from Project items
@(ReferenceCopyLocalPaths,ReferenceComWrappersToCopyLocal,ResolvedIsolatedComModules,_DeploymentLooseManifestFile,NativeReferenceFile).
Gather all files from Project items @(AllExtraReferenceFiles). Adding:
Gather all files from Project items
@(_SourceItemsToCopyToOutputDirectoryAlways,_SourceItemsToCopyToOutputDirectory). Adding:
bin\lib\Newtonsoft.Json.Net35.dll
Gather all files from Project items @(_binDeployableAssemblies). Adding:
Publish Pipeline Collect Files Phase
Found The following for Config tranformation:
Web.config
Creating directory "C:\SVN\TrakNet\trunk\MTS\obj\Debug\TransformWebConfig\transformed\".
Publish Pipeline Transform Phase
Creating directory "C:\SVN\TrakNet\trunk\MTS\obj\Debug\CSAutoParameterize\transformed\".
Copying Web.config to obj\Debug\CSAutoParameterize\original\Web.config.
Transforming Source File: C:\SVN\TrakNet\trunk\MTS\Web.config
  Applying Transform File: <?xml version="1.0"?>
        <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
          <connectionStrings>
            <add
              connectionString="{% token='$(ReplacableToken_#(parameter)_#(tokennumber))' xpathlocator='name' parameter='$(name)-Web.config Connection String' description='$(name) Connection String used in web.config by the application to access the database.' defaultValue='$(connectionString)' tags='SqlConnectionString' %}"
              xdt:Transform="SetTokenizedAttributes(connectionString)" xdt:SupressWarnings="True" />
          </connectionStrings>
        </configuration>
      Output File: obj\Debug\CSAutoParameterize\transformed\Web.config
    Transformation succeeded
Auto ConnectionString Transformed Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config.
Creating directory "obj\Debug\Package\PackageTmp".
Copying all files to temporary location below for package/publish:
obj\Debug\Package\PackageTmp.
Copying bin\LMS.dll to obj\Debug\Package\PackageTmp\bin\LMS.dll.
Copying bin\LMS.pdb to obj\Debug\Package\PackageTmp\bin\LMS.pdb.
Copying Global.asax to obj\Debug\Package\PackageTmp\Global.asax.
Copying lib\Newtonsoft.Json.Net35.dll to obj\Debug\Package\PackageTmp\lib\Newtonsoft.Json.Net35.dll.
Copying MtsSchemas\MtsSchema.xml to obj\Debug\Package\PackageTmp\MtsSchemas\MtsSchema.xml.
Copying C:\SVN\TrakNet\trunk\MTS\lib\Newtonsoft.Json.Net35.dll to obj\Debug\Package\PackageTmp\bin\lib\Newtonsoft.Json.Net35.dll.
Copying obj\Debug\CSAutoParameterize\transformed\Web.config to obj\Debug\Package\PackageTmp\Web.config.
Publish Pipeline Deploy phase Pre-Deploy CopyAllFilesToOneFolder Stage
Generate source manifest file for Web Deploy package/publish ...
Creating directory "obj\Debug\Database".
Starting Web deployment task from source:manifest(C:\SVN\TrakNet\trunk\MTS\obj\Debug\Package\LMS.SourceManifest.xml) to Destination:auto().
Updating filePath (default web site/LMS\bin\ELMS.dll).
Updating filePath (default web site/LMS\bin\ELMS.pdb).
Updating filePath (default web site/LMS\bin\lib\Newtonsoft.Json.Net35.dll).
Updating filePath (default web site/LMS\lib\Newtonsoft.Json.Net35.dll).
Updating filePath (default web site/LMS\Web.config).
Updating setAcl (default web site/LMS).
Updating setAcl (default web site/LMS).
Successfully executed Web deployment task.
Publish is successfully deployed.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
----构建已启动:项目:LMS,配置:调试任何CPU------
构建开始于2011年8月3日上午9:10:12。
GenerateTargetFrameworkMonitorAttribute:
跳过目标“GenerateTargetFrameworkMonitorAttribute”,因为所有输出文件相对于输入文件都是最新的。
_CopyOutofDateSourceItemsOutputDirectoryAlways:
正在将文件从“C:\SVN\TrakNet\trunk\MTS\lib\Newtonsoft.Json.Net35.dll”复制到“bin\lib\Newtonsoft.Json.Net35.dll”。
CopyFilesToOutputDirectory:
LMS->C:\SVN\TrakNet\trunk\MTS\bin\LMS.dll
构建成功。
时间流逝00:00:00.04
------发布已启动:项目:LMS,配置:调试任何CPU------
从项目项@(中间部件)收集所有文件。添加:
bin\LMS.dll到bin\LMS.dll
bin\LMS.pdb到bin\LMS.pdb
从项目项@(内容)中收集所有文件。添加:
Global.asax;lib\Newtonsoft.Json.Net35.dll;MtsSchema\MtsSchema.xml;Web.config
从项目输出(IntermediatesTelliteSassembliesWithTargetPath)收集所有文件。
添加:
从项目项中收集所有文件
@(ReferenceCopyLocalPath、ReferenceComWrappersToCopyLocal、ResolvedIsolatedComModules、_DeploymentLooseMansifestFile、NativeReferenceFile)。
从项目项@(AllExtraReferenceFile)收集所有文件。添加:
从项目项中收集所有文件
@(_SourceItemsToCopyToOutputDirectoryAlways,_SourceItemsToCopyToOutputDirectory)。添加:
bin\lib\Newtonsoft.Json.Net35.dll
从项目项@(_binDeployableAssemblies)收集所有文件。添加:
发布管道收集文件阶段
为配置转换找到以下内容:
Web.config
正在创建目录“C:\SVN\TrakNet\trunk\MTS\obj\Debug\TransformWebConfig\transformed\”。
发布管道转换阶段
正在创建目录“C:\SVN\TrakNet\trunk\MTS\obj\Debug\csautoparametrize\transformed\”。
正在将Web.config复制到obj\Debug\csautoparametrize\original\Web.config。
转换源文件:C:\SVN\TrakNet\trunk\MTS\Web.config
应用转换文件:
输出文件:obj\Debug\csautoparametrize\transformed\Web.config
转化成功
自动连接字符串将Web.config转换为obj\Debug\csautoparametrize\Transformed\Web.config。
正在创建目录“obj\Debug\Package\PackageTmp”。
将所有文件复制到以下临时位置以进行打包/发布:
obj\Debug\Package\PackageTmp。
正在将bin\LMS.dll复制到obj\Debug\Package\PackageTmp\bin\LMS.dll。
正在将bin\LMS.pdb复制到obj\Debug\Package\PackageTmp\bin\LMS.pdb。
正在将Global.asax复制到obj\Debug\Package\PackageTmp\Global.asax。
正在将lib\Newtonsoft.Json.Net35.dll复制到obj\Debug\Package\PackageTmp\lib\Newtonsoft.Json.Net35.dll。
正在将MtsSchemas\MtsSchema.xml复制到obj\Debug\Package\PackageTmp\MtsSchemas\MtsSchema.xml。
正在将C:\SVN\TrakNet\trunk\MTS\lib\Newtonsoft.Json.Net35.dll复制到obj\Debug\Package\PackageTmp\bin\lib\Newtonsoft.Json.Net35.dll。
正在将obj\Debug\csautoparametrize\transformed\Web.config复制到obj\Debug\Package\PackageTmp\Web.config。
发布管道部署阶段预部署CopyAllFilesToOneFolder阶段
为Web部署包/发布生成源清单文件。。。
正在创建目录“obj\Debug\Database”。
从源清单(C:\SVN\TrakNet\trunk\MTS\obj\Debug\Package\LMS.SourceManifest.xml)到目标:auto()启动Web部署任务。
正在更新文件路径(默认网站/LMS\bin\ELMS.dll)。
正在更新文件路径(默认网站/LMS\bin\ELMS.pdb)。
正在更新文件路径(默认网站/LMS\bin\lib\Newtonsoft.Json.Net35.dll)。
正在更新文件路径(默认网站/LMS\lib\Newtonsoft.Json.Net35.dll)。
正在更新文件路径(默认网站/LMS\web.config)。
正在更新setAcl(默认网站/LMS)。
正在更新setAcl(默认网站/LMS)。
已成功执行Web部署任务。
发布已成功部署。
======生成:1成功或最新,0失败,0跳过==========
=========发布:1成功,0失败,0跳过==========

就像我说的:不知道发生了什么变化。我一直在手动将DLL移动到网站的虚拟目录中,然后只是为了好玩,我今天早上尝试发布,一切都很顺利。

根据我的经验,当从源代码管理的不同分支添加/删除文件时,可能会发生这种情况,不完美的合并会导致项目文件结构和实际文件结构出现分歧

这可能是以下几种选择之一:

  • 文件已删除,但项目仍引用该文件。将无法编译,将无法发布
  • 已添加文件,但项目未引用该文件。可以编译,这取决于类/方法是否在项目/解决方案中的其他位置引用。如果编译,将发布
  • 添加了一个文件,但项目合并导致该文件在项目列表中多次出现。将编译,将无法发布

解决方案是查看源代码管理日志,并尝试识别上述问题与项目文件的错误合并,然后相应地修复项目文件。

我在手动将文件夹复制到项目中时遇到了类似的问题(在我的案例中是ckeditor)。它构建得很好,在本地运行,没有任何问题。然而,当p