WCF Service update UPS. Operation is not valid due to the current state of the object.

I try import custom data to custom user properties from my own wcf service (on sharepoint server machine), but i got
Message "Operation is not valid due to the current state of the object. "
on line
userProfile[PropertyConstants.Department].Value = "SDDDD";
Why i cant modify property value?
SPSecurity.RunWithElevatedPrivileges(delegate()
using (SPSite site = new SPSite("http://portal.local"))
SPServiceContext serviceContext = SPServiceContext.GetContext(site);
using (var web = site.OpenWeb())
Debug.WriteLine(web.CurrentUser); //Here AppPoolAccount user of current wcf service
Debug.WriteLine(WindowsIdentity.GetCurrent().Name); //Here too AppPoolAccount user of current wcf service
UserProfileManager userProfileMgr = new UserProfileManager(serviceContext);
ProfilePropertyManager profilePropMgr = new UserProfileConfigManager(serviceContext).ProfilePropertyManager;
ProfileSubtypePropertyManager subtypePropMgr = profilePropMgr.GetProfileSubtypeProperties("UserProfile");
UserProfile userProfile = userProfileMgr.GetUserProfile(accountName);
userProfile[PropertyConstants.Department].Value = "SDDDD";
userProfile.Commit();
My service running under domain\SPSvcAcc what have full permissions on UPS service, it's management account and UPS admin with full rights.
If i create console app with identical code and run it under SPSvcAcc account it working without problems
What i do wrong?

Hi,
pls seee if you can add threading like this below to solve the pbm
https://social.technet.microsoft.com/Forums/office/en-US/b6d6f85c-e12b-4540-a821-690e296b7b56/operation-is-not-valid-due-to-the-current-state-of-the-object-exception-when-activating-a?forum=sharepointdevelopmentprevious
Please remember to click 'Mark as Answer' on the answer if it helps you

Similar Messages

  • Error occurred in deployment step 'Add Solution': Operation is not valid due to the current state of the object

    hi,
      when i was trying to deploy a SP  solution from my vs 2012 solution. this error  is displayed.
    i tried many things like
    1) get the wsp and apply power shell cmds to add and deploy, here also it failed:
    Add-SPSolution -LiteralPath d:\mywsp.wsp
    Install-SPSolution mywsp.wsp -GacDeployment -AllWebApplications -Local
    2) restart the timer services and  do  iisreset and  reboot the server. etc .as mentioned in one of the  the below  blogs:
    http://sharepoint1on1.blogspot.in/2014/04/sharepoint-error-occurred-in-deployment.html
    http://suehernandez.wordpress.com/2011/03/31/error-occurred-in-deployment-step-activate-features-operation-is-not-valid-due-to-the-current-state-of-the-object/
    http://www.dotnetsharepoint.com/2014/04/error-occurred-in-deployment-step-add.html
    http://social.msdn.microsoft.com/Forums/en-US/63adde23-03cf-4b65-923e-1219da94a780/error-occurred-in-deployment-step-add-solution-operation-is-not-valid-due-to-the-current-state-of?forum=sharepointdevelopmentprevious
    http://www.shakirmajeed.com/error-occurred-in-deployment-step-activate-features-operation-is-not-valid-due-to-the-current-state-of-the-object/
    but even after doing all these steps, the  error still persists!. and am not deploying into a remote server, the dev env is in a VM, where sp 2013, vs 2012, sql 2012  are installed.
    just wanna share one  note:   there is a isue in my search admin component. index was reset due to some reason. and from that time onwards my search full/incremental crawls were not working!
    will this cause an issue in my wsp deployment ? i hope  it wont, still  asking...
    can anyone help me how to resolve this error.because this is a  show stopper for me for the last few days!
    help is highly appreciated!

    This issue cause because of feature activation failure while WSP deployment.
    when you create a WSP using visual studio, it creates WSP package with default deployment configuration settings.
    Please restrict feature activation configuration, this will help you to troubleshoot this issue.
    - Click on Project in WSP and press F4, it will open "Project Properties"
    - set "Active deployment Configuration" - as "No Activation"
    - you can activate this features in required sequence after deployment using Activate-SPFeature
    If my contribution helps you, please click Mark As Answer on that post and Vote as Helpful
    Thanks, ShankarSingh(MCP)

  • The update operation is not allowed in the current state of the request

    When users have logged a request through the service manager 2012 portal and they go back in to add user input they sometimes receive a message that says " The update operation is not allowed in the current state of the request." The state of the
    request has not changed it is still Active and has not breached its service level .
    I can't seem to find any information about this error and don't know how to troubleshoot it. Any help and advice would be appreciated.
    Thanks
    Sarah

    ok, so they're adding user comments after creating the service request. looks like this:
    the first thing to check is that the user is added to the default, un-scoped "End User" security role, or the custom end user security role they are added to has a scope that includes all work items. The "user input" field adds a user comment related
    to the SR, so the ability to create user comments is required to use this field.

  • Microsoft RMS Add-in Operation is not valid due to the current state of the object

    Microsoft Rights Management sharing application for Windows
    Microsoft Windows 7/Office 2010 Service Pack 2
    Click 'Share Protected'
    Receive the following error message 'Microsoft RMS Add-in Operation is not valid due to the current state of the object'
    Microsoft Windows 7/Office 2013 Service Pack 1
    Works fine
    Any ideas why this is not working?

    Hi lra,
    As per my understanding, I think this issue can be caused by MaxHttpCollectionKeys settings in report manager web.config file.
    For more details, please refer this similar thread to override the default value of MaxHttpCollectionKeys:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/cb6ede72-6ed1-4379-9d3c-847c11b75b32/report-manager-operation-cannot-run-due-to-current-state-of-the-object?forum=sqlreportingservices
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Error_27_Error occurred in deployment step 'Activate Features': Operation is not valid due to the current state of the object.

    I created a SharePoint 2013 farm solution project in Visual Studio 2013 (running on the same machine where SharePoint 2013 server is running) with
    event receiver.  I added web.config at project root level to store connection string (I'm working off external SQL DB) and got the following error during deployement:
    Error 27
    Error occurred in deployment step 'Activate Features': Operation is not valid due to the current state of the object.
    When I commented out the ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString; the error went away.  Am I missing something or not supposed to add my own App.config to SharePoint project solution? 

    Hi,
    From your description, you might want to store your connection string in web.config and there is an error during deployment.
    It is recommended to store the configuration data of SharePoint solution in either property bags or hierarchical object store.
    The links below will provide more information about this:
    http://blogs.msdn.com/b/zwsong/archive/2012/03/27/where-should-you-store-your-sharepoint-solution-s-configuration-data.aspx
    http://msdn.microsoft.com/en-us/library/ff647766.aspx
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • "Operation is not valid due to the current state of the object" error when trying to create a link for a shared folder in OneDrive

    I'm trying to share a folder in OneDrive with another user in my organization, and create a link so that people outside of the company can see the folder. Whenever I try to create a link I get an error that says: "Couldn't create the link sorry something
    went wrong operation is not valid due to the current state of the object" How do I resolve this?

    Hi,
    Sorry for replying late and I noticed that you posted another thread in this forum:
    http://social.technet.microsoft.com/Forums/en-US/2b8c6f54-9c59-4b37-b28f-1d49a1b7913b/operation-is-not-valid-due-to-the-current-state-of-the-object-error-when-trying-to-create-a-link?forum=officeitpro
    I've replied and kindly refer to it to see if it is helpful.
    Regards,
    Melon Chen
    TechNet Community Support

  • Reporting Service Integration mode and Key not valid for use in specified state

    I had to uninstall SharePoint Foundation 2013 and reinstall it.
    What I have done:
    I uninstalled SharePoint and after that I removed all databases.
    I reinstalled SharePoint Foundation 2013 and it completed without errors.
    Everything else is working, except SSRS in Sharepoint Integrated Mode.
    If I check Central Administration - Manage services on server, I can found out that SQL Server Reporting Service Service is
    "Started". But if I try to create new service application (SQL Server Reporting Services Service Application), it gives me an error message:
    "Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B)"
    I uninstalled SSRS in Sharepoint Integrated Mode and I reinstalled it but problems exists.
    It seems that "Encryption Keys" cause this problem.
    https://support.microsoft.com/kb/955757
    https://msdn.microsoft.com/en-us/library/ms156010%28v=sql.110%29.aspx
    I tried to Re-create Encryption Keys and Delete keys, but its not working either. It gives me only error message that:
    "Unable to locate the Reporting Server Windows service for instance MSSQLSERVER."
    I don't have any reporting server databases, because I removed all
    databases when I uninstalled SharePoint. Also I don't have Encryption
    Keys backups.
    I have found several similar question but no answer, example here:
    https://social.technet.microsoft.com/Forums/ie/en-US/df02dc05-5ce8-499d-9ba3-ab392a5fc3af/sharepoint-2013-ssrs-application-error-key-not-valid-for-use-in-specified-state-exception?forum=sharepointdevelopment
    Any ideas how I can fix this problem?

    Hi,
    From the Reporting Server Configuration Manager you have to restore the encryption key.
    Please try to delete databases(reportserver & reportservertempdb) and delete the reportserver and reports site on IIS. Then you have to start over the configuration again.
    If the issue still exists, Please check ULS log to see if anything unexpected occurred.
    For SharePoint 2013, by default, ULS log locates in
    "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS"
    More information about SQL Reporting services Installation with SharePoint 2013 for your reference:
    http://expertsharepoint.blogspot.de/2014/03/sql-reporting-services-installation.html
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Operation is not valid due to the current state of the object

    We are working with the System.Transactions for transaction control. An error is happening when confirming a transaction. Even without having changed any information. The user opens a register and does not modify any information, press the Change button and generates the error. Is not processed any UPDATE, DELETE, INSERT. Only queries. Below is the error details:
    Data base: Oracle 11g
    Application Server: Windows 2003 64 bits. Client 11g 32 bits and 64 bits
    Location: System.Transactions
    StackTrace:
    at System.Transactions.TransactionState.ChangeStatePromotedCommitted(InternalTransaction tx)
    at System.Transactions.DurableEnlistmentDelegated.Committed(InternalEnlistment enlistment)
    at System.Transactions.SinglePhaseEnlistment.Committed()
    at Oracle.DataAccess.Client.PromotableTxnMgr.SinglePhaseCommit(SinglePhaseEnlistment spe)
    at System.Transactions.TransactionStateDelegatedCommitting.EnterState(InternalTransaction tx)
    at System.Transactions.TransactionStateDelegated.BeginCommit(InternalTransaction tx, Boolean asyncCommit, AsyncCallback asyncCallback, Object asyncState)
    at System.Transactions.CommittableTransaction.Commit()
    at System.Transactions.TransactionScope.InternalDispose()
    at System.Transactions.TransactionScope.Dispose()
    at FPw.InfraEstrutura.DataAccess.FPwTransacao.Dispose()
    at LG.FPw_Cad.ServicoMapeador.Servicos.FichaCad.Update(Int32 lUserId, Int32 lMatFunc, LGVariant avRegFun, LGVariant avRegATF, Double dSalario, Boolean bConsiste)

    What I meant is that it's done any kind of alteration of the tables involved, because the user does not change any of your information on the screen.
    The problem happens on a client and does not happen in our test environment.
    The version of Oracle.DataAccess both 32-bit and 64 bit is 2.112.1.0.
    What is the code in the following summary:
    1) Is created transactional context:
    Dim TxOptions As New TransactionOptions
    Dim OpcaoDeEscopo As TransactionScopeOption
    Dim Transacao As System.Transactions.TransactionScope
    TxOptions.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
    OpcaoDeEscopo = TransactionScopeOption.Required
    Transacao = New TransactionScope(opcaoDeEscopo, TxOptions, EnterpriseServicesInteropOption.Full)
    2) From this point are open connections are made and query commands to the database.
    Are opened and closed connections to the database.
    3) At the time of effecting the transaction Dispose of the error happens:
    Transacao.Dispose
    Note: Our way of working has its own peculiarities, the connection pool is always disabled: ";Pooling = false". It is inserted directly in the connection string. We need to do this because the pool had memory problems turned prey.
    Therefore the process of opening and closing connections, you can leave the system slow. So to avoid open connections within the transactional context, in some cases we enforce the transaction enlist. As follows:
    Dim TransacaoCorrente As ITransaction = CType(ContextUtil.Transaction, ITransaction)
    Conexao.EnlistDistributedTransaction(TransacaoCorrente)
    Can you help us?
    Edited by: 893128 on Oct 25, 2011 9:24 AM

  • Error occurred in deployment step 'Activate Features': Operation is not valid due to the current state of the object.

    I recently copied a solution from one dev box to another. After pushing through a handful of other errors I hit a wall with this one. Any hints as to the human translation would be appreciated. The solution works on the original box. Also if there's
    a way to make the Forum Category list on this page smaller but with more items while making the icons and white space bigger, Microsoft would like to know. Thanks

    Hi George Takei,
    This is a common error message which is not easy to find the root cause directly.
    Here are some general checking steps:
    Check to make sure you haven’t change any objects like namespace, class name, that make feature cannot find specified class.
    Deactivate the feature on the site, reset IIS, and redeploy the solution.
    Kill the vssphost4.exe in Task Manager, to redeploy the feature.
    If the issue persists, it would be better to share the solution here to help to do troubleshooting, what’s the solution used for, is it an event receiver, feature, workflow or other type?
    Thanks,
    Qiao Wei
    TechNet Community Support

  • SSRS runtime error - The specified operation is not valid

    I found a similar post here, but it didn't solve my problem. so i re-post it.
    i develop a report with vs2008. i have sql 2008 r2 on my local machine. when i preview the report on my local machine all fine. but when i deployed the report to sql 2008 ssrs server, i got "#Error" in my subtotal field. i opened the log file and found the
    error message:
    The specified operation is not valid. , ;
     Info: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: The specified operation is not valid.
    i used a formular in the expression:
    =Sum(IIf(Fields!flag.Value="S",Fields!Size.Value,0))
    can someone help?
    thanks

    I want to make my problem more clear:
    1. with the original formula: =Sum(IIf(Fields!Fundflag.Value="S",Fields!FundSize.Value,0)) works very well on my local machine with clicking on Preview. Once deploy to server, i got error.
    2.Shahfaisal, your formula works on both side, but not the result i except. because the size field in sp unioned from different source. i only want to subtotal when flag is "S".
    any help will be appreciated!
    Try this
    =Sum(IIF(IsNumeric(Fields!Size.Value)
    AND Fields!flag.Value="S",Fields!Size.Value,0))

  • Operation is no valid due to current state of object.

    I have created a web part. And in that web part I have a link which refer to a page in share point with query string.
    Some thing like as :
    <a href=http://sharepoint:79/codelibrary/PageName.aspx?Id=1/>
    It gives the error that Operation is not valid due to current state of object.
    But when I call this page with out Id=1 or without any query string, it works fine.
    Please help me, where I am doing wrong.
    Many Thanks

    Hi Naeem,
    Thanks for posting your query, Kindly Do NOT call .Update() inside Evelvated Permission’s delegate Just do it below SPSecurity.RunWithElevatedPrivileges
    Also, Check out the detail for more details in below mentioned URL
    http://blogs.msdn.com/b/suresh/archive/2014/08/26/getting-quot-operation-is-not-valid-due-to-the-current-state-of-the-object-quot-error.aspx
    I hope this is helpful to you. If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • ERROR: "key not valid for use in specified state" when updating to Lightroom 5.6 in Win8.1

    While doing a routine update from Lightroom 5.5 to v5.6 in Win 8.1, the installation halted at the start of the installation with the vague error message, "key not valid for use in specified state".  Although v5.5 was working just fine, the install routine deleted the v5.5 application files.  I rolled back to the previous system restore point (set just prior to the install) and recovered the executable files.  However, now the 5.5 files won't open the default catalog, none of the backups, or even create a new catalog.
    As v5.x was purchased as an update to v4.x, I've tried to reinstall the original Lightroom v4.x app from the factory disk.  I get the same error.
    Suggestions?
    Thanks. Dan

    I have a similar problem to Dan. while doing a routine upgrade from Lightroom 5.5 to 5.6 I got the
    : "key not valid for use in specified state"
    error and now Lightroom has completely disappeared. I've tried to uninstall, but there is nothing to uninstall. Going back to try to install the original 5.4 just results in the same error.
    A problem may have been that I closed Lightroom when the upgrade started to download. It then re-opened again when the install was halfway through., I assumed that was an error and closed it. just after that the error first appeared in the installer.
    I still had an older version of lightroom 4 installed. I've uninstalled it, and that didn't make any difference.
    I've also tried removing anything in the registry left over from the old installs and that didn't help either.
    Any suggestions?
    CHeers, Angus

  • Problem updating Lightroom "key not valid for use in specified state"

    Hi,
    I am having problems with installing the update 5.6 of Lightroom from 5.2.
    I downloaded and ran the updater. It has uninstalled my previous version of Lightroom but now each time I try to run the installer it fails, with the message "key not valid for use in specified state".
    I have tried restarting to no avail.
    Any ideas?

    Searching Google for the error and Lightroom, the two forum threads that come up are:
    1)      Installing Muse the user wasn’t logged in as an administrator level user and after they logged in as an administrator user and did the install, again, it worked.
    2)      A recent Windows Update seemed to interfere with something and the user did a system restore back to a few weeks, ago, reinstalled their previous version of LR, and then installed LR 5.6 and then did the Windows Updates again and everything was ok.

  • Tried updating to 11.4 Itunes and it says "key not valid for use in specified state"

    when I  tried to update ITunes to 11.4 I get an error message saying " key not valid for use in specified state"  I tried uninstalling iTunes and downloading the new version but it still won't download.  I also tried syncing my Iphone 6 and it wouldn't let me until I updated to 11.4 which brings me back to my problem???

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    For further problems installing iTunes see Troubleshooting issues with iTunes for Windows updates.
    tt2

  • MBAM 2.5 Web Applications installation - "Web service application pool account is not valid"

    Hi,
    I've created a Server 2012R2 installation to install MBAM 2.5. When installing the Web Applications I keep getting "The web service application pool account is not valid". 
    The account I am using is a standard domain account with admin rights on the Server and I've also set the SPN (both netbios and FQDN) and Delegation.
    This account is also a member of the group that is defined as RW of the SQL databases (which were setup without any problem and are on a separate  Server 2008R2, SQL 2008R2 installation.
    I am also getting an error with the SSRS URL , stating "SQL Server Reporting Services URL that points to the MBAM reports is not valid", despite being able to browse to the http://[FQDN]/ReportServer_MBAM location.
    Thanks.

    I got this kind of error when I revert back my virtual machine a lot to my previous checkpoints. I hope this can't be an issue for you.
    Make sure the application pool account must have the following login roles on the SQL server and have following rights on the reporting instance:-
    Required SQL Server permissions
    The user responsible for installing MBAM database and reporting feature must have the local administrator privileges and the following log in permission:-
    SQL Server instance login server roles:
    dbcreator
    processadmin
    SQL Server Reporting Services instance rights:
    Create Folder
    Publish Reports
    SQL Server Database Engine Services: SQL Server Database Engine Services must be installed and running during MBAM Server installation.
    SQL Server Reporting Services (SSRS): SSRS must be installed and running during the MBAM Server installation. Configure SSRS in "native" mode and not in "SharePoint" mode.
    Gaurav Ranjan

Maybe you are looking for

  • Call between 2 computers on the same account

    I have two computers on the same account. One is my home office desktop, the other is my mobile. This is useful as both computers use the same credit account. In addition, if I am travelling, or I am at the office, people are still able to contact me

  • Find Window file path utility

    Hi All! I have used a nifty utility or extension or preference that displays the full directory path at the bottom of the finder window. I'd like to make this happen in Lion. Anyone know the secret? Thanks, Greg

  • Need to understand how shipping point will get determin in the STO.

    Hi MM Gurus, Please let me know how shipping point will get determin in the STO, and  other shipping tab details like shipping condition loading group get determine in the STO. Thanks and Regards, SHARAN.

  • How many calendars can you synch between iPhone and outlook?

    i've been happily synching 2 calendars but recently added a 3rd on Outlook.  it is not appearing on the phone.  it is, however, there on my iPad.

  • ACR is not copying the XMP along with the CR2

    I have this problem intermittently..   I have a folder with CR2 files and their corresponding XMP files.   I select a few CR2s, right click on one and select "Copy To" and I copy them to another folder.  Most of the time it copies my XMP with it.  On