2

我已经安装了 Azure SDK 2.5。当我运行命令时:

"C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\bin\cspack.exe" .\ServiceDefinition.csdef "/out:Package.cspkg" 

我有一个例外:

Unhandled Exception: System.Runtime.Remoting.RemotingException: Object '/8ba37d11_3239_4c7c_9f1a_aa967b1dc5e9/eocq0iwbskmwhdjkfth7xtqy_4.rem' has been disconnected or does not exist at the server.
at System.IO.FileStream.get_CanRead()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.CheckFileAccessParameter(Stream stream, FileAccess access)
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.GetStream(FileMode mode, FileAccess access)
at System.IO.Packaging.ZipPackagePart.GetStreamCore(FileMode mode, FileAccess access)
at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
at Microsoft.ServiceHosting.Tools.Packaging.Utils.CopyFullStreamToPart(Stream source, PackagePart part, PackageManifest manifest)
at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreateRolePackages(ModelProcessor modelProcessor, PackageManifest applicationManifest, Package applicationPackage)
at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreatePackage(Stream outputStream, Action`1 postProcess, PackageRestrictions restrictions)
at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, IPackageSecurity encrypt, Dictionary`2 namedStreamCollection, String userInfo, EventHandler`1 rolePackagePartAddedHandler)
at Microsoft.ServiceHosting.Tools.MSBuildTasks.PackageCreator.CreateServiceApplicationPackage(String serviceRdFilePath, String processedServiceDefinitionFile, FileStream packageStream, Dictionary`2 namedStreams, Dictionary`2 rolesDictionary)
at Microsoft.ServiceHosting.Tools.MSBuildTasks.PackageCreator.CreateServiceApplicationPackage(String serviceRdFilePath, String processedServiceDefinitionFile, FileStream packageStream, Dictionary`2 namedStreams, Dictionary`2 rolesDictionary)
at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.TryCreatePackage(ServiceDefinitionModel sm)
at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.Execute()
at Microsoft.ServiceHosting.Tools.Packaging.Program.Main(String[] args)

同时这个包在其他机器上构建成功。

有人面对这个问题吗?

4

2 回答 2

0

这是 SDK 2.5 中为长时间运行的 CSPack 进程引入的错误。在即将发布的 2.6 版本中对此进行了修复。

于 2015-03-25T23:12:08.233 回答
0

在我们的例子中,它只发生在我们用于自动部署到我们的测试环境的一台机器(Win Server 2008R2)上,我们可以使用 CSPack 解决方法。

解决方法包括两个步骤:

  1. MSBuild 失败,但在创建包的最后一步失败,因此应打包到包中的所有文件都在文件夹“AzureProject\obj\Release\WebRoleName”中。
  2. 手动运行 CSPack:

    $releaseWebAppPath = "$tempPath\AzureProject\obj\Release\WebRoleName"
    & $cspackPath "$slnRootPath\AzureProject\ServiceDefinition.csdef" /role:"WebRoleName;$releaseWebAppPath" /sitePhysicalDirectories:"WebRoleName;Web;$releaseWebAppPath" /out:"$packagePath"
    

这将创建一个您应该能够部署的包。

于 2015-07-19T02:58:54.783 回答