.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

copy document fails

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :Windows Application


i have a form application, within my form application i have placed a document.

this document i will copy and place on my c drive: File.Copy(Path.Combine(Environment.CurrentDirectory, @"..\..\test.docx"), @"C:\Werkbons\" + Id + ".docx", true);

the document recieve a different name.

when i run my project the document will be placed in this directory.


i have taken the exe from the debug folder, and run this on a different computer.

the document will not be copyd to the directory.

why can my programme copy a document when i run it from visual studio project, and not when i start the exe?

View Complete Post

More Related Resource Links

Cannot copy document to other library

When I try to send a document to another SharePoint library (Send To>Other Location) I am receiving a blank message box.  Does anyone have an idea what the empty message box is about or why this error is occurring?  Thank you!

Invalid URL"" after copy or move a document.



We have an website that have 3 libraries. The "first Library" is used only to edit documents and it's called "my documents". When a user finish of edit your documents here, they start a workflow that will check fields in the document and move the document for the second library (using Sharepoint Designer Workflow - without custom actions).
In "second library" we have a big workflow. This WF has some steps for approve, collect feedback, generate sub-tasks and others things related for the document. This WF use many custom actions in (Sharepoint Designer).
When this WF arrives to the end, the document is moved to "third library", that is a official repository of documents in the enterprise.
The entire cycle works fine. But when someone creates a internal copy of the document in the "first library" to begin again the flow, we receive a Invalid Url error. It occurs when any update operations is executed over the document item, the value is conserved but the error is displayed. After it, we can not execute other workflows over the item.
If we save the document in local disk, delete the library item, and then upload it again, the problem is solved.

Some one have an idea about why and how solve it?  We are using WSS 3.0.

The following is an error registred in log file when you d

Check-out issue when opening a document from a document library when a read-only copy is open

We have an issue when a user has a read-only copy of a document from SharePoint open and then tries to check-out and edit another copy of the document (i.e. from the document library) the checked out copy is not connected to the web server. For the user it will look the same they will make edits, save and then close, but when they do so the document is not updated in SharePoint - it may be saved locally in their SP drafts, but the user will think that they have lost their version. We then get the checked out to another user error and you have to discard changes to get the document working again. Steps to reproduce this issue: * click on the name of a office doc on a Document Library * Make sure "Read Only" is selected and click "ok" * Minimize open document * click on the same file on the Document Library * Make sure "check out and edit" is selected and the "Use my local drafts folder" checkbox is ticked. Select OK. * Edit document and press save. Changes are never saved back in SharePoint, they are only on the local draft. We are using MOSS with SP2. Clients are on Office 2003 and 2007 Is this normal behaviour? Is there anything that can be done to prevent this from happening?

Copy/Paste Fails in Management Studio

After opening Management Studio and doing some editing it is possible to copy/paste things in the query editor. After a while (working in another app) I come back to Management Studio and I can't copy/paste anything anymore. If I try to copy from the results window I get an error message that the clipboard operation did not succeed. If I try to copy from the query editor window it just doesn't copy. I can copy/paste in other apps without a problem.   I have seen this problem described in other forums so I'm not alone but I have 3 other computers where this problem does not occur. The one machine with the problem is hyper-threading. I wonder .... Any other ideas? It is not the clipboard getting full but I can't rule out much else.

SQL Server 2008 installation fails There was an error generating the XML document. Error code 0x84B

My system config: window XP - SP3 4 GB RAM, I have VS2008 with SP1, VS2010 Ultimate installed First when I tried to install SQL 2008 R2 Dev edition I got an error saying vs2008 SP1 was not installed, infact I had the SP1 installed in my m/c.  I did reinstalled the SP1 and tried to install SQL again. while in the final installation process I got the error  "Setup has encountered the following error: There was an error generating the XML document. Error code 0x84B10001." I uninstall the SQL server again to remove the files which were created from Unsuccessful installation I removed the register entry as suggested by this forum. reinstalled but no chance, I have tried all the option which I can get know in web. Please help me. here is the log files details  Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException 2010-08-26 14:54:53 Slp:     Message: 2010-08-26 14:54:53 Slp:         There was an error generating the XML document. 2010-08-26 14:54:53 Slp:     Stack: 2010-08-26 14:54:53 Slp:         at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache) 2010-08-26 14:54:53 Slp:   &nb

Content Query Web Part (CQWP) fails to show picture items from a document/picture library in an anon

I have a Picture Library and am trying to use the CQWP to display a list of items in the library.  The web part shows the items fine in authenticated mode, but it fails to show the items to anonymous users. The error log message is: Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.SetDocumentIconUrlAndOnClickString(SPWeb web, DataRow row, String strDefaultItemOpen, Boolean fSetDocIcon, Boolean fSetOnClick, String fileRefColumnRef, String progIdColumnRef, String fsobjTypeColumnRef, String permMaskColumnRef)     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.PreProcessForDocumentIconAndOnClickAttribute()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.AddContentQueryData()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.GetXPathNavigator(String viewPath)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform) I'm running SP 2010.  I've tried various scenarios including: 1. Using the default publishing template. 2. Using the blank site template with publishing and lock down features enabled. 3. Us

Copy Attachment from List to Document Library

Is it possible, to do that. I always get an error : The workflow could not copy the item. Make sure the source and destination lists have the same columns and column settings. I would like to  copy attachment if  new list item has one, after is created. In workflow, when I chose Document Library, there is filed name: Path and Name (*).Borut

Sharepoint 2010 Workflow to copy a document

I want to create a workflow where: When a document is modified, it is copied to a new folder. I can do this with the "copy list item" action, but it only allows me to select certain lists (document libraries for example), instead of being able to give a full pathname to a folder.  What's the correct action to copy the Current Item to specific folder within the same library.  Or alternately, to create a list that IS the correct folder. Thanks, -Mike

Bug report: MouseMove on document fails over disabled objects.

I found a bug in the event handler code of the client library related to document-mousemove and disabled DomElements. Steps to reproduce: 1. Add an input button to the page and disable it:               <input type="button" id="Button1" value="Button 1" disabled="disabled" />  2. Attach a mousemove event to the document in the init event of the application:              Sys.Application.add_init(function() { $addHandler(document,'mousemove',function(e) { }); }); 3. Run the page in IE and move the mouse over the disabled button. An exception is thrown:             Microsoft JScript runtime error: Sys.ArgumentException: Value must be a DOM element. Parameter name: element This problem occurs because the event target is not null, but an empty object. The DomEvent handler tries to get the location of the element, but fails when it realizes that this is not a DomElement (Since MSAJAX doesn't check for argument types in non-debug mode, it there tries to get a property of the object that doesn't exist which fails too). Because of IE's buggy mouseover/out eventhandlers, attaching a mousemove event to the document is

Copy site in same site collection fails in MOSS2007


Hello, everyone:

  In our MOSS2007 environment, we have a '/countries/' site collection level, underneath which there are several country-sites. We give the local webmaster of each country site  'full control' permission.

  However, one local webmaster encounter copy action failing error while she definitely has been granted 'full control' permission in this site. The error is as below.

  We tested with site collection level admin, it works fine. Therefore, we suspect that there could be a hidden thing in this site that even local webmasters cannot access?

Best regards,


Site Content and Structure: Copy


Operation to Copy '/countries/abc/temp/test_mo

SQLServer2008 job created by Copy DataBase Wizard fails - cannot determine if job owner has server a


Trying to copy a SQL2000 database on server TUNA to destination server MOJITO which runs default instance of SQL2008 (at ServicePack1) via the CD Wizard. Resulting job fails on MOJITO with this in application log:

SQL Server Scheduled Job 'CopyDatabaseWizard_TUNA_MOJITO_1' (0x64AB69F2880A7E4DA3708546C33DFF40) - Status: Failed - Invoked on: 2010-09-23 17:05:04 - Message: The job failed. Unable to determine if the owner (CBMIWEB\johna) of job CopyDatabaseWizard_TUNA_MOJITO_1 has server access (reason: Could not obtain information about Windows NT group/user 'CBMIWEB\johna', error code 0x5. [SQLSTATE 42000] (Error 15404)).

There is a credential on MOJITO defined for CBMIWEB\johna. There is a proxy on MOJITO that uses that credential. The job has one step and in the properties I have set the RUN AS value for the job to be the name of the Proxy. The proxy is established for SSIS jobs.

The "owner" of the job is also CBMIWEB\johna which is a domain userid in the local Administrators group of each machine (both TUNA and MOJITO). This userid has been granted the permission to Logon as a Batch Job on both servers.

TUNA is a Windows 2000 standalone server; MOJITO is Windows 2003. I can logon to each server as CBMIWEB\johna.

I don't know what else to do.

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();


VWD 2010: Copy Web Fails if File Exists on Remote Site



I just started using VWD 2010 and I used Copy Web to upload the site to the server. However, whenever I try to upload a new version of a file that I've already uploaded, the upload fails, with this error in the log (as an example):

Copy from 'C:\Users\Lou\Documents\Visual Studio 2010\WebSites\genusus10\tools' to '' started at 10/6/2010 4:00:33 PM.
            Copy file password.aspx.vb from source to remote Web site.
            Has error -- Unable to add 'tools/password.aspx.vb' to the Web site.  The file tools/password.aspx.vb has been modified by (unknown) on 06 Oct 2010 11:45:33 -0500.

Copy from 'C:\Users\Gen\Documents\Visual Studio 2010\WebSit

Copy List Item in SPD 2010 Workflow Fails if Check Out/Check In Required


I've seen this issue on 3 different Sharepoint 2010 implementations, including upgrades and fresh installations...

The workflow, which works fine in WSS 3.0/MOSS, operates on change of a document.  Workflow reviews a specific column and based on contents of that column, it checks out the document, copies the current item from the current library to another library in the same site and then deletes the item in the current library.

In SharePoint 2010, the following occurs.  Again, this occurs in the upgraded workflow as well as in a brand new workflow created with SPD 2010 on a site that blank / not upgraded.

  • Workflow starts on an item that is verified to not already be checked out.
  • Document is checked out
  • Document IS copied to the other library
  • Workflow fails and is canceled with the following errors:
    The workflow could not copy the item. Make sure the source and destination lists have the same columns and column settings.  (They do.)
    The workflow operation failed because the action requires the document to be checked out. (The item is checked out by workflow - as is evidenced by the fact that the item is still checked out after workflow fails.)
  • RESULT:  the copy operation does work, workflow thinks it doesn't and fails on that step, item is not deleted

I've tes

Document Set - SPD Workflow - Copy Document Set from one DocLib to another


Hi All,

Env : SP 2010 Enterprise - SPD 2010.

I'm trying to make a SPD Workflow that must copy a Document Set Item from one document Library to Another and it doesn't Work. 

I'm using the Copy List Item Action in My WF and when it runs, an error occured : "The workflow could not copy the item. Make sure the source and destination lists have the same columns and column settings."

Does Someone already get success for Copy Document Set from a Library to another ?

Thanks for your help.


Mister Barber

Using WebDav & RoboCopy to copy docs between Document Libraries


I am trying to automate the process of copying documents between SharePoint 2010 document libraries using a RoboCopy job which calls WebDav. My Farm is running on Server 2008 R2 Hyper-V.

What is most puzzling (and annoying) is that I have a development environment where the job works perfectly - it is in staging and production where I am having problems. Throughout all of the environments I can successfully browse to the document libraries in question using Explorer View.

This is the command I am running:

ROBOCOPY \\%serveralias%\DavWWWroot\sites\%library1% "\\"serveralias%\DavWWWroot\sites\%library%

And these are the error messages I'm receiving:

Error 1 - The specified network name is no longer available

Error 2 - A device attached to the system is not functioning

I can confirm that the following are running:

Desktop Experience (via Server Manager), WebClient (Via Windows Services)

Does anyone have any suggestions?








Using the "Send To" function to copy SSRS reports (.rdl) from one document library to another

We are trying to use the "Send To" function to let users get copies of SSRS reports, but still retain the ability to roll out changes by updating the original.  This would help us have "one version of the truth" but still have the ability to copy reports from one SharePoint site to another.  One reason to have the report on multiple sites is to give users the ability to set default values for the parameters.  IT creates one copy and the users configure it to meet their own needs.

Copying the file using "Send To" works.  However, it loses the data source link which effectively kills the copied report.  We have tried this in various forms of permissions and sequences, but experience the same issue consistently.  Obviously, one could re-enter the data source link, but that is not optimal.

We saw the same behavior when we copied the report out of Windows Explorer from library to another.

Is this is a known issue?  Can it be fixed?  If so, how?
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