Re: DocLibEvent SPFile.CopyTo error

Tech-Archive recommends: Fix windows errors by optimizing your registry



I dont know wich of the two solutions worked. I changed the
impersonating script to the one adviced by Microsoft. And i upped my
memory on the virtual machine, and now it worked, thanks alot :)

Alexander van der Kolk


Eugene Rosenfeld wrote:
I've sometimes gotten COM exceptions in SharePoint if the server is running
low on memory. If you are running in a virtual machine, try allocating more
memory to it.

--
-Eugene Rosenfeld

"S.S. Ahmed" <ss_ahmed1@xxxxxxxxxxx> wrote in message
news:uIUbezv5GHA.4604@xxxxxxxxxxxxxxxxxxxxxxx
Try impersonating as an admin.

http://support.microsoft.com/?kbid=823278&FR=1

http://support.microsoft.com/?id=909455

--
S.S. Ahmed
www.walisystems.com


"Kolky" <a.vanderkolk@xxxxxxxxx> wrote in message
news:1159870371.997791.70740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear SharePoint Developers,

I have a Document Library where a event is linked to it wich does the
following:

public void OnEvent(SPListEvent evt)
{
if(evt.Type == SPListEventType.Insert)
{
SPWeb web = evt.Site.OpenWeb();
SPFile file = web.GetFile(evt.UrlAfter);

string url = evt.Title + "\\Example\\" + file.Name;

try
{
file.CopyTo(url,true);
}
catch {}
}
}

Everytime i upload a new document i get the exception below. I've
searched the net and on this usenet group found something about
changing the IPermission and changing the trust level to full. I did
both and still i keep getting this error. Anyone has any idea /
suggestion or hint that could help me.

I edited the IPermission to the files: wss_mediumtrust.config &
wss_minimaltrust.config
In the folder: C:\Program Files\Common Files\Microsoft Shared\web
server extensions\60\CONFIG

And i changed the trust level in the file: web.config
In the folder: C:\\inetpub\wwwroot\



Microsoft.SharePoint.SPException: Cannot complete this action.

Please try again. ---> System.Runtime.InteropServices.COMException
(0x80004005): Cannot complete this action.

Please try again.
at
Microsoft.SharePoint.Library.SPRequestInternalClass.OpenWebInternal(String
bstrUrl, String& pbstrServerRelativeUrl, UInt32& pnLanguage, UInt32&
pnLocale, String& pbstrAlternateCSSUrl, String& pbstrCustomJSUrl,
String& pbstrAlternateHeaderUrl)
at Microsoft.SharePoint.Library.a.a(String A_0, String& A_1, UInt32&
A_2, UInt32& A_3, String& A_4, String& A_5, String& A_6)
--- End of inner exception stack trace ---
at Microsoft.SharePoint.Library.a.a(String A_0, String& A_1, UInt32&
A_2, UInt32& A_3, String& A_4, String& A_5, String& A_6)
at Microsoft.SharePoint.SPWeb.f()
at Microsoft.SharePoint.SPWeb.get_ServerRelativeUrl()
at Microsoft.SharePoint.SPWeb.get_Url()
at Microsoft.SharePoint.SPFile.a(String A_0, Boolean A_1, Boolean
A_2)
at Microsoft.SharePoint.SPFile.CopyTo(String strNewUrl, Boolean
bOverWrite)
at DocSpaceEvent.ServiceTest.OnEvent(SPListEvent evt)


Hope someone could help me!

Thanks,

Alexander van der Kolk




.



Relevant Pages

  • Re: Large text file - in memory ( > 60mb)
    ... You would need some logic added to keep track of an entire recordset, which can be a string[] of length 9 ... Then I have to show this record found (wich should be ... I was just wondering why the current app is consuming so much memory wich is ...
    (microsoft.public.dotnet.framework)
  • System.AccessViolationException in .NET 2.0 application
    ... This is often an indication that other memory is corrupt. ... curselFilename, Boolean fileMustExist, Boolean showfilename, Boolean ... multiselect, String title, String filter, String& selectedFiles) ... HandleRef hMenu, HandleRef hInst, Object pvParam) ...
    (microsoft.public.dotnet.general)
  • Attempted to read or write protected memory. This is often an indication that other memory is corrup
    ... Attempted to read or write protected memory. ... System.RuntimeTypeHandle._GetTypeByName(String name, Boolean ... ANWB.ConsumeWebService(String url, String postXML, String userName, ... eventArgument) +7 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Fast string operations
    ... Looping: I thought looping over arrays in managed code was "slow" ... array handling and such. ... The problem with TrimHelper is that it always returns a new string instance. ... The customer perceives this as a memory leak. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Discovering variable types...
    ... >- but I suppose MS expect us to use wrappers ... memory allocations for your variables from disk as well. ... >They most certainly are of fixed size, changing the size of a String ... >>me to keep buffer size and current postion right in the memory block. ...
    (comp.lang.pascal.delphi.misc)