.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

.NET Matters: File Copy Progress, Custom Thread Pools

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

More Related Resource Links

.NET Matters: Deserialization Progress, and More


Build a standard progress bar that indicates how much deserialization has completed and how much still remains. Plus, System.Collection.Generics performance.

Stephen Toub

MSDN Magazine December 2006

"Mixed mode assembly is built against version 'v2.0.50727'.... " issue and use custom config file

Hi, My Winform applilcation has used Microsoft.SqlServer.Management.Common namespace(assembly :Microsoft.Sqlserver.smo.dll/Microsoft.Sqlserver.ConnectionInfo.dll) and developed in .NET 4.0. Problem:Application is throw an exception when it tries to use above assembly reference methods. Full error text is shown below, "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. " Error is resolved when we include "app.config" file with below code, <?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration> But, I need to keep configuration file as "renamed.config" and not to include app.config file as of the project requirement.I have set configuration file as "renamed.config" file using below code, //AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "d:\\reanmed.config" ); I have also included <Startup> element in this "renamed.config" configuration file and removed the app.config file.But it raise me below error, it always expect app.config file with <Startup> element to resolve this iss

Can not copy: The file exists. (Explorer View)

Hello Community,               I used to copy bunch of files from windows explorer to sharepoint 2007 document library in its explorer view. But now I could not. It gives me error "Can not copy xyz: The file exists". The files does not exists already.             I also created many different new files [Different Name/Different File Type] and copy to server but still no luck. I have logged in to SharePoint with Admin Account and verified that no such file already exists.             I have the many machines and using Windows XP and Windows 7. For Windows 7 I never found the problem and Windows XP [with IE 6] if I use normal user for windows logon [Normal user have the “Full Control” permission in SP] I cannot use drag and drop files. It shows the error message “Cannot copy file <filename> The file exists”. For “My Network Places” I created and point to document libraries such as http://serversite/Docs [“Docs” It’s a document libraries list] but no luck. I tried from multiple Windows XP workstations and It works in few but cannot make out any differences between these machines.          &n

SQL-Server 2005 x64 / windows server 2003 x64 crashes during file copy

Hi We are running: Microsoft SQL Server 2005 Standard - 9.00.4294.00 (X64) Microsoft Windows Server 2003 R2 Enterprise x64 We have gigabit interface. Today we copied a file (using robocopy) from our databaseserver to another server (backup-server). The copy was started from the backup-server and source were specified using UNC. The copy were using about 20% of the bandwith (about 200Mbit). During the copy, sql-server reported several errors, for example: AppDomain 15 (mp.dbo[runtime].14) is marked for unload due to memory pressure. The client was unable to reuse a session with SPID 75, which had been reset for connection pooling. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message. ***Stack Dump being sent to [PATH\SQLDump0005.txt Resource Monitor (0x1384) Worker 0x000000008000C1C0 appears to be non-yielding on Node 0. Memory freed: 0 KB. Approx CPU Used: kernel 15 ms, user 218 ms, Interval: 428541. So to me it appears that sql-server crashed during a file copy. We have 27 GB ram. With 24.5 GB dedicated to SQL-Server. The files we copied were quite large, some over 50GB. I found a similar issue about this: http://support.microsoft.com/kb/920739/ Do you think the issue above could be the cause of the sql-server crash? ///Patrik

Creating a new root Site Collection using a custom site definition file (ONET.XML)

Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following: Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite I get the error "WARNING: Template is not found and is not applied." When I run Get-SPWebTemplate, my site definition does not show up. I saw this: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5ea46e07-a4b0-4bab-b698-9b6eeb695607 but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting. I have also tried: IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308) Nothing seems to work.  Does anyone have any ideas?

Powershell script to copy a list attachment to a file

I have a script that builds a list of items.  I'd like to add the ability to download the list items' attachments to a local directory.  IS this possible?  There are lots of examples of how to add attachments but nothing that can download the attachments.  Any help would be appreciated.

Binding to a custom App.Config file in dotnet 4.0

Hi, I need to resolve Mixed Mode assembly issue using below text in configuration file. <?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration> But, it seems to be work only in APP.CONFIG file. and does not work in custom configurationfile (custom.config).   I gone through the below article: http://weblogs.asp.net/israelio/archive/2005/01/10/349825.aspx still it does not work seems to be work for resolve Mixed mode assemly issue. Please let me know if any one has idea on this.   Thanks, Dhaval Soni    

SPTimerJobDefinition to copy xml file to all wfe's

I am thinking of creating a timer job that reads some data from some lists and in the end generates an xml file. The XML file is copied to a specific location and it needs to exist in that location on all of the web front ends. The question I have is that using a SharePoint Job if I run some code that copies it to that location (lets say somewhere in the layouts folder) will it automatically copy it to that location on all web front ends?Visit my blog http://jasear.wordpress.com

How to include a javascript file in a custom action?

I need to call a custom javascript function from a ribbon button, how do I include the javascript file within the custom action solution in order that it will be properly referenced by the html output? I am not allowed to define a custom masterpage at this point. So what can I do?   Thanks, Stephan  

Attach File to Custom List

Hello - I need to use the Client Object Model to attach an item to a custom list item.  I have attachments enabled on the custom list.  The following code will upload a attachment to a list item ONLY if at least one attachment was added to the item via SharePoint. Dim credentials As New System.Net.NetworkCredential(MyUser, MyPassword, MyDomain) Dim SiteUrl As String = "http://spsandbox13" Dim clientContext As New ClientContext(SiteUrl) clientContext.Credentials = credentials '-- List item 41 hard coded for testing Dim attachmentPath As String = String.Format("/{0}/Lists/{1}/Attachments/{2}/{3}", "sites/ITS/GBPlayground", "FormConfiguration", "41", "SomeFileNameForMe7") Using fs As New FileStream("C:\Users\gbadmin\Documents\WhatsUp.txt", FileMode.Open) Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, attachmentPath, fs, True) End Using The above code works great as long as the item already has an attachment.  If the item doesn't have an attachment I get a (409): Conflict error.  I've also tried to create a folder in the attachments folder for the list item to see if once the folder was created that the error would go away.  The code for this is as follows: Dim list As Microsoft.SharePoint.Client.List = clientContext.Web.Lists.GetByTitle("

write Custom MemberShip provdider only to read the connection string from other file

hi,    In asp.net mvc project I am using MYSQlMemberShipProvider. Now I want that instead of reading the connection string from web.config file, it will read the connection string from external file every time. So that I am implementing the cutsom mebership provider class, this class inherits the MemberShipProvider class.    But the problem is that if I inherits the MemberShipProvider class then I have to impelment all of its method in my cutsom membership provider class, But I want to use all other inbuilt methods of MemeberShip. What can i do.I only want to add the code like below: public class CustomSqlMembershipProvider :MembershipProvider    {        public override void Initialize(string name, NameValueCollection configs)        {            base.Initialize(name, configs);                Connectionstring objProducts = // redaing the connection string.   }}But on compiltaion it is giving me the error does not implement inherit abstract member. Please Suggest me any idea.        Thanks In AdanaceAayushi

Cannot create/shadow copy 'Microsoft.Practices.EnterpriseLibrary.Data' when that file already exis

Lately I am getting this error when compiling my application. Does anybody have an idea what is going wrong??? Cannot create/shadow copy 'Microsoft.Practices.EnterpriseLibrary.Data' when that file already exists. === Pre-bind state information ===LOG: User = DREAMCATCHER\BischiLOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data Calling assembly : (Unknown).===LOG: This bind starts in default load context.LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/shareyourlossweb/887ea9ec/383e808e/Microsoft.Practices.EnterpriseLibrary.Data.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/shareyourlossweb/887ea9ec/383e808e/Microsoft.Practices.EnterpriseLibrary.Data/Microsoft.Practices.EnterpriseLibrary.Data.DLL.LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).ERR: Failed to complete setup of assembly (hr = 0x800700b7). Probing t

Can't copy LDF file after detaching database.

Hello, I'm attempting to move an LDF file from one drive to another with more space.  I've detached the database in question, but when I go to copy the file I get the error, "Cannot copy [filename].  It is being used by another person or program." Is there another SQL Server process that is keeping this file locked?  How would I check? Thanks for your help.

LINQ to SQL Compact db, file copy issue

Our application uses LINQ and SQL compact database .sdf file as datasource.  It is using Miscrosoft SQL Server Compact 3.5 SP 1 and .NET Framework 3.5 SP1. We store our application's project data into a .sdf file.  When our application opens a .sdf file (e.g. projectA.sdf), it will make a temporary copy of it and open the temporary file instead of the original file.  If we change one table cell value (i.e. one property value of an object that is created by LINQ), and call DataContext.SubmitChanges(ConflictMode.ContinueOnConflict), and then call File.Copy(DataContext.Connection.Database, filename, true); to copy the temporary file back to the original file (replacing the original one).   We found that the table value is not changed in projectA.sdf.  But in the temporary copy, the value is changed.  If we re-open db connection by calling DataContext.Connection.Close(); DataContext.Connection.Open(); right before calling File.Copy(), the changed value is copied successfully to projectA.sdf. If we do a lot of value changes in the database, or adding / deleting table row, then submit changes.  Without re-opening the db connection, after File.Copy(), the projectA.sdf have those changes copied. This strange behaviour looks like the temporary db file is cached.  For a small change, the cached version is not changed.  The File.Copy() use t

Downloading a document from a sharepoint site to local file system, copy web service returns null

Hi Guys,
               I am trying to get this done for the last 2 days and I am still banging my head to the wall.
All I need to do is to download files from my sharepoint site library that uses integrated windows authentication. I was using copy webservice : getItem method to accomplish this.

CopyService.GetItem(copySource, out myFieldInfoArray, out myByteArray);

Problem : myByteArray is always returned as NULL

Note: I have tried the same with another site that uses forms authentication but the result was the same (NULL !!)

This is my code:


Copy copy = new CopyService.Copy();


Copy file from SFTP


Hi all,
I need to create an application which copies files from SFTP and paste them on my computer.

Can anyone please tell me how can I do this. I do not want to use any library of other providers like j* or others.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend