gpt4 book ai didi

asp.net - 构建成功,但发布失败

转载 作者:行者123 更新时间:2023-12-02 01:23:16 24 4
gpt4 key购买 nike

直到两天前,我还可以通过右键单击我的项目并单击上下文菜单上的“发布”按钮来使用 Visual Studio 2010 的“发布 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 ==========

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

最佳答案

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

这可能是以下几个选项之一:

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

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

关于asp.net - 构建成功,但发布失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6903337/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com