MSDN > 論壇首頁 > Windows Azure > Packaging problems: IsolatedCSPack failed
發問發問
 

已答覆Packaging problems: IsolatedCSPack failed

  • Monday, 29 June, 2009 11:09jacek_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hello,

    Again the problems with my 30MB library. This time the issue is with packaging. After clicking on 'Publish...' menu option in VS2008 the OutOfMemoryException occurs (show below). Using CSPack.exe tool from command line, however, gives strange output:

    For the command:
       cspack RScriptEngine2\ServiceDefinition.csdef /role:WebRole;RScriptEngine2 /out:REngine.cspkg

    OutOfMemoryException is thrown, whereas for:
       cspack RScriptEngine2\ServiceDefinition.csdef /role:WebRole;RScriptEngine2

    a package ServiceDefinition.cspkg is produced that takes 329 MB ! The same package deployed onto DevelopersFabric takes about 3x30MB = 95MB

      Best regards,
      Jacek


    Error    22    The "IsolatedCSPack" task failed unexpectedly.
    System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

    Server stack trace:
       at System.IO.MemoryStream.set_Capacity(Int32 value)
       at System.IO.MemoryStream.EnsureCapacity(Int32 value)
       at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at MS.Internal.IO.Packaging.PackagingUtilities.CopyStream(Stream sourceStream, Stream targetStream, Int64 bytesToCopy, Int32 bufferSize)
       at MS.Internal.IO.Packaging.SparseMemoryStream.WriteToStream(Stream stream)
       at MS.Internal.IO.Zip.ZipIOFileItemStream.Save()
       at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Save()
       at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)
       at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)
       at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)
       at System.IO.Stream.Close()
       at System.IO.Packaging.PackagePart.Close()
       at System.IO.Packaging.Package.DoClose(PackagePart p)
       at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)
       at System.IO.Packaging.Package.System.IDisposable.Dispose()
       at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreateRolePackages(ModelProcessor modelProcessor, PackageManifest applicationManifest, Package applicationPackage)
       at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreatePackage(Stream outputStream)
       at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, IPackageSecurity encrypt, Dictionary`2 namedStreamCollection, String userInfo)
       at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, RSACryptoServiceProvider encrypt, Dictionary`2 namedStreamCollection, String userInfo)
       at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.TryCreatePackage(ServiceModel sm)
       at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.Execute()
       at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.RemoteCSPackBridge.Execute(TaskLoggingHelper log, IBuildEngine buildEngine, ITaskHost hostObject, String serviceHostingTasksPath, String output, String serviceDefinitionFile, ITaskItem[] packRoles, String developmentSSLCertificateThumbprint, String publishSSLCertificateThumbprint, Boolean copyOnly, String generateConfigurationFile, Boolean noEncryptPackage, ITaskItem[]& copiedFiles, ITaskItem[]& outputFiles)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.RemoteCSPackBridge.Execute(TaskLoggingHelper log, IBuildEngine buildEngine, ITaskHost hostObject, String serviceHostingTasksPath, String output, String serviceDefinitionFile, ITaskItem[] packRoles, String developmentSSLCertificateThumbprint, String publishSSLCertificateThumbprint, Boolean copyOnly, String generateConfigurationFile, Boolean noEncryptPackage, ITaskItem[]& copiedFiles, ITaskItem[]& outputFiles)
       at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.Execute()
       at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)    C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets    604    5    RScriptEngine2

解答

  • Thursday, 2 July, 2009 9:21Yi-Lun LuoMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    I see. You've set Copy to Output Directory to Copy if newer. That's why it get copied for multiple times. Since the Build Action is already set to Content, you do not need to set Copy to Output Directory to Copy if newer. Please set it to never.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • 已標示為解答jacek_ Thursday, 2 July, 2009 10:49
    •  

所有回覆

  • Monday, 29 June, 2009 14:47Tom ChristianMSFT使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    What does your .csx folder look like?  It is under the project folder that holds your config files.  Under the bin folder.  Do you see that much data in there?
  • Monday, 29 June, 2009 16:25jacek_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Sorry, I was supposed to put this in the previous post. This question is related to a discussion about including a native library into a project. Please follow this link to get more info:
    http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0f2313f2-9823-4b33-a9ba-30e2b95b5e4f
    • 已編輯jacek_ Monday, 29 June, 2009 16:27
    • 已編輯jacek_ Monday, 29 June, 2009 16:26
    • 已編輯jacek_ Monday, 29 June, 2009 16:26
    •  
  • Tuesday, 30 June, 2009 7:36Yi-Lun LuoMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hello, will it be possible for you to provide a project? I can't reproduce the problem on my side. The dll is only copied to WebRole, not WebRole/bin.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
  • Tuesday, 30 June, 2009 11:56jacek_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Sure. Please find this project at: https://wiki.cs.ncl.ac.uk/personal/jacek.cala/Home?action=AttachFile&do=get&target=RScriptEngine2.zip

    I attached a .zip file to the project. Maybe this is the problem?

      Cheers,
      Jacek
  • Wednesday, 1 July, 2009 10:16Yi-Lun LuoMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I can't access the site. It requires authentication... Can you please upload the project to SkyDrive?
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
  • Wednesday, 1 July, 2009 11:30jacek_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Sorry, I forgot about that.
    I've put it to SkyDrive under my public folder. Please follow this link: http://tinyurl.com/km8n23
  • Thursday, 2 July, 2009 3:10Yi-Lun LuoMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Excuse me, but I still cannot access it. 404 not found...
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
  • Thursday, 2 July, 2009 7:57jacek_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Strange, so try one of the following links:

    http://cid-bc38327788ac8b17.skydrive.live.com/self.aspx/.Public/RScriptEngine2.zip

    http://ukfj2a.bay.livefilestore.com/y1psNSqB6oM0KQmEITlgYTLeTfv7c3LFTrPPV6C3Rx0LVFIwu1ZkDMNaXTSnYmosWa-bffH4LNhavReA2qV2f4zfQ/RScriptEngine2.zip?download

      Cheers,
      Jacek
  • Thursday, 2 July, 2009 9:21Yi-Lun LuoMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    I see. You've set Copy to Output Directory to Copy if newer. That's why it get copied for multiple times. Since the Build Action is already set to Content, you do not need to set Copy to Output Directory to Copy if newer. Please set it to never.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    • 已標示為解答jacek_ Thursday, 2 July, 2009 10:49
    •  
  • Thursday, 2 July, 2009 10:49jacek_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Perfect! This was the problem. Actually, I could not find any clear explanation of relation between 'Build Actions' and 'Copy To Output Directory' settings. MSDN help is not very exhaustive, maybe you could point to some good source of info.