Packaging problems: IsolatedCSPack failedHello,<br/> <br/> 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:<br/> <br/> For the command:<br/>    <strong>cspack RScriptEngine2\ServiceDefinition.csdef /role:WebRole;RScriptEngine2 /out:REngine.cspkg</strong> <br/> <br/> OutOfMemoryException is thrown, whereas for:<br/> <strong>   cspack RScriptEngine2\ServiceDefinition.csdef /role:WebRole;RScriptEngine2</strong> <br/> <br/> a package ServiceDefinition.cspkg is produced that takes <strong>329 MB</strong> ! The same package deployed onto DevelopersFabric takes about 3x30MB = <strong>95MB</strong> <br/> <br/>   Best regards,<br/>   Jacek<br/> <br/> <br/> Error    22    The &quot;IsolatedCSPack&quot; task failed unexpectedly.<br/> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.<br/> <br/> Server stack trace: <br/>    at System.IO.MemoryStream.set_Capacity(Int32 value)<br/>    at System.IO.MemoryStream.EnsureCapacity(Int32 value)<br/>    at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)<br/>    at MS.Internal.IO.Packaging.PackagingUtilities.CopyStream(Stream sourceStream, Stream targetStream, Int64 bytesToCopy, Int32 bufferSize)<br/>    at MS.Internal.IO.Packaging.SparseMemoryStream.WriteToStream(Stream stream)<br/>    at MS.Internal.IO.Zip.ZipIOFileItemStream.Save()<br/>    at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Save()<br/>    at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)<br/>    at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)<br/>    at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)<br/>    at System.IO.Stream.Close()<br/>    at System.IO.Packaging.PackagePart.Close()<br/>    at System.IO.Packaging.Package.DoClose(PackagePart p)<br/>    at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)<br/>    at System.IO.Packaging.Package.System.IDisposable.Dispose()<br/>    at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreateRolePackages(ModelProcessor modelProcessor, PackageManifest applicationManifest, Package applicationPackage)<br/>    at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreatePackage(Stream outputStream)<br/>    at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, IPackageSecurity encrypt, Dictionary`2 namedStreamCollection, String userInfo)<br/>    at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, RSACryptoServiceProvider encrypt, Dictionary`2 namedStreamCollection, String userInfo)<br/>    at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.TryCreatePackage(ServiceModel sm)<br/>    at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.Execute()<br/>    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[]&amp; copiedFiles, ITaskItem[]&amp; outputFiles)<br/>    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp; outArgs)<br/>    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp; outArgs)<br/>    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)<br/> <br/> Exception rethrown at [0]: <br/>    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br/>    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)<br/>    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[]&amp; copiedFiles, ITaskItem[]&amp; outputFiles)<br/>    at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.Execute()<br/>    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean&amp; taskResult)    C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets    604    5    RScriptEngine2<br/>© 2009 Microsoft Corporation. All rights reserved.Thu, 02 Jul 2009 10:49:25 Z0708caf9-593d-47c0-8a66-097b1bdd7490http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#0708caf9-593d-47c0-8a66-097b1bdd7490http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#0708caf9-593d-47c0-8a66-097b1bdd7490jacek_http://social.msdn.microsoft.com/Profile/en-US/?user=jacek_Packaging problems: IsolatedCSPack failedHello,<br/> <br/> 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:<br/> <br/> For the command:<br/>    <strong>cspack RScriptEngine2\ServiceDefinition.csdef /role:WebRole;RScriptEngine2 /out:REngine.cspkg</strong> <br/> <br/> OutOfMemoryException is thrown, whereas for:<br/> <strong>   cspack RScriptEngine2\ServiceDefinition.csdef /role:WebRole;RScriptEngine2</strong> <br/> <br/> a package ServiceDefinition.cspkg is produced that takes <strong>329 MB</strong> ! The same package deployed onto DevelopersFabric takes about 3x30MB = <strong>95MB</strong> <br/> <br/>   Best regards,<br/>   Jacek<br/> <br/> <br/> Error    22    The &quot;IsolatedCSPack&quot; task failed unexpectedly.<br/> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.<br/> <br/> Server stack trace: <br/>    at System.IO.MemoryStream.set_Capacity(Int32 value)<br/>    at System.IO.MemoryStream.EnsureCapacity(Int32 value)<br/>    at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)<br/>    at MS.Internal.IO.Packaging.PackagingUtilities.CopyStream(Stream sourceStream, Stream targetStream, Int64 bytesToCopy, Int32 bufferSize)<br/>    at MS.Internal.IO.Packaging.SparseMemoryStream.WriteToStream(Stream stream)<br/>    at MS.Internal.IO.Zip.ZipIOFileItemStream.Save()<br/>    at MS.Internal.IO.Zip.ZipIOLocalFileBlock.Save()<br/>    at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)<br/>    at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)<br/>    at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)<br/>    at System.IO.Stream.Close()<br/>    at System.IO.Packaging.PackagePart.Close()<br/>    at System.IO.Packaging.Package.DoClose(PackagePart p)<br/>    at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)<br/>    at System.IO.Packaging.Package.System.IDisposable.Dispose()<br/>    at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreateRolePackages(ModelProcessor modelProcessor, PackageManifest applicationManifest, Package applicationPackage)<br/>    at Microsoft.ServiceHosting.Tools.Packaging.PackageCreator.CreatePackage(Stream outputStream)<br/>    at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, IPackageSecurity encrypt, Dictionary`2 namedStreamCollection, String userInfo)<br/>    at Microsoft.ServiceHosting.Tools.Packaging.ServiceApplicationPackage.CreateServiceApplicationPackage(String serviceModelFileName, String serviceDescriptionFile, Stream output, RSACryptoServiceProvider encrypt, Dictionary`2 namedStreamCollection, String userInfo)<br/>    at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.TryCreatePackage(ServiceModel sm)<br/>    at Microsoft.ServiceHosting.Tools.MSBuildTasks.CSPack.Execute()<br/>    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[]&amp; copiedFiles, ITaskItem[]&amp; outputFiles)<br/>    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp; outArgs)<br/>    at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp; outArgs)<br/>    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)<br/> <br/> Exception rethrown at [0]: <br/>    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)<br/>    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)<br/>    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[]&amp; copiedFiles, ITaskItem[]&amp; outputFiles)<br/>    at Microsoft.CloudExtensions.MSBuildTasks.IsolatedCSPack.Execute()<br/>    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean&amp; taskResult)    C:\Program Files\MSBuild\Microsoft\Cloud Service\v1.0\Microsoft.CloudService.targets    604    5    RScriptEngine2<br/>Mon, 29 Jun 2009 11:09:52 Z2009-06-29T11:09:52Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#fb9ad827-c821-415e-a5ff-32be58078d9bhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#fb9ad827-c821-415e-a5ff-32be58078d9bTom Christianhttp://social.msdn.microsoft.com/Profile/en-US/?user=Tom%20ChristianPackaging problems: IsolatedCSPack failedWhat 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?Mon, 29 Jun 2009 14:47:51 Z2009-06-29T14:47:51Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#9cf2be0e-e4b9-44ac-ae2d-2cd690e8cb0ahttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#9cf2be0e-e4b9-44ac-ae2d-2cd690e8cb0ajacek_http://social.msdn.microsoft.com/Profile/en-US/?user=jacek_Packaging problems: IsolatedCSPack failedSorry, 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:<br/> http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0f2313f2-9823-4b33-a9ba-30e2b95b5e4fMon, 29 Jun 2009 16:25:20 Z2009-06-29T16:27:46Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#415306bc-1646-4e34-b62f-8299d67e63b0http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#415306bc-1646-4e34-b62f-8299d67e63b0Yi-Lun Luohttp://social.msdn.microsoft.com/Profile/en-US/?user=Yi-Lun%20LuoPackaging problems: IsolatedCSPack failedHello, 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.<hr class="sig">Lante, shanaolanxing This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Tue, 30 Jun 2009 07:36:44 Z2009-06-30T07:36:44Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#4187ab7d-f1b0-4cc7-9456-2751caa0ba4fhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#4187ab7d-f1b0-4cc7-9456-2751caa0ba4fjacek_http://social.msdn.microsoft.com/Profile/en-US/?user=jacek_Packaging problems: IsolatedCSPack failedSure. Please find this project at: <a href="https://wiki.cs.ncl.ac.uk/personal/jacek.cala/Home?action=AttachFile&amp;do=get&amp;target=RScriptEngine2.zip">https://wiki.cs.ncl.ac.uk/personal/jacek.cala/Home?action=AttachFile&amp;do=get&amp;target=RScriptEngine2.zip</a> <br/> <br/> I attached a .zip file to the project. Maybe this is the problem?<br/> <br/>   Cheers, <br/>   Jacek<br/>Tue, 30 Jun 2009 11:56:50 Z2009-06-30T11:56:50Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#1941ac1e-e978-478e-97aa-4fcf036b69c6http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#1941ac1e-e978-478e-97aa-4fcf036b69c6Yi-Lun Luohttp://social.msdn.microsoft.com/Profile/en-US/?user=Yi-Lun%20LuoPackaging problems: IsolatedCSPack failedI can't access the site. It requires authentication... Can you please upload the project to SkyDrive?<hr class="sig">Lante, shanaolanxing This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Wed, 01 Jul 2009 10:16:20 Z2009-07-01T10:16:20Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#c62f1c80-9268-449c-8265-4e1db32d5a5dhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#c62f1c80-9268-449c-8265-4e1db32d5a5djacek_http://social.msdn.microsoft.com/Profile/en-US/?user=jacek_Packaging problems: IsolatedCSPack failedSorry, I forgot about that. <br/> I've put it to SkyDrive under my public folder. Please follow this link: <a href="http://tinyurl.com/km8n23">http://tinyurl.com/km8n23</a>Wed, 01 Jul 2009 11:30:55 Z2009-07-01T11:30:55Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#2541bc1c-7d7e-4ef4-b4ce-e6b860710d4fhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#2541bc1c-7d7e-4ef4-b4ce-e6b860710d4fYi-Lun Luohttp://social.msdn.microsoft.com/Profile/en-US/?user=Yi-Lun%20LuoPackaging problems: IsolatedCSPack failedExcuse me, but I still cannot access it. 404 not found...<hr class="sig">Lante, shanaolanxing This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Thu, 02 Jul 2009 03:10:24 Z2009-07-02T03:10:24Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#4eadc930-a5ca-4b05-a781-baa18440ff09http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#4eadc930-a5ca-4b05-a781-baa18440ff09jacek_http://social.msdn.microsoft.com/Profile/en-US/?user=jacek_Packaging problems: IsolatedCSPack failedStrange, so try one of the following links:<br/> <br/> http://cid-bc38327788ac8b17.skydrive.live.com/self.aspx/.Public/RScriptEngine2.zip<br/> <br/> http://ukfj2a.bay.livefilestore.com/y1psNSqB6oM0KQmEITlgYTLeTfv7c3LFTrPPV6C3Rx0LVFIwu1ZkDMNaXTSnYmosWa-bffH4LNhavReA2qV2f4zfQ/RScriptEngine2.zip?download<br/> <br/>   Cheers,<br/>   Jacek<br/>Thu, 02 Jul 2009 07:57:12 Z2009-07-02T07:57:12Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#fa2089cd-3939-46a2-8543-8940c5d25de4http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#fa2089cd-3939-46a2-8543-8940c5d25de4Yi-Lun Luohttp://social.msdn.microsoft.com/Profile/en-US/?user=Yi-Lun%20LuoPackaging problems: IsolatedCSPack failedI 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.<hr class="sig">Lante, shanaolanxing This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Thu, 02 Jul 2009 09:21:28 Z2009-07-02T09:21:28Zhttp://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#ddb74a56-287e-4b17-8bba-6211061b7687http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/0708caf9-593d-47c0-8a66-097b1bdd7490#ddb74a56-287e-4b17-8bba-6211061b7687jacek_http://social.msdn.microsoft.com/Profile/en-US/?user=jacek_Packaging problems: IsolatedCSPack failedPerfect! 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.<br/> <br/>Thu, 02 Jul 2009 10:49:21 Z2009-07-02T10:49:21Z