none
Webpart runs only in debug mode RRS feed

  • Question

  • I have a problem on a webpart that runs only in debug mode. When I deploy the wsp and I execute there is always an error. I do not understand why ?
    Monday, January 30, 2017 4:25 PM

All replies

  • Is there any correlation ID that SharePoint gives you as part of the error? If yes then go through the ULS logs and get the detailed error message and share that error message. 


    Amit

    Monday, January 30, 2017 4:34 PM
  • Hi Amit,

    I have an exception: Value does not fall into the expected range but if I am in debug mode the code works correctly.

    Tuesday, January 31, 2017 11:11 AM
  • Hi,

    Your package is not included all the artifacts those required for WebPart. Please check the features and assemblies are correctly included in the WSP packages through Visual Studio Package Designer.


    Murugesa Pandian | MCPD | MCTS | SharePoint 2010 |

    Tuesday, January 31, 2017 11:28 AM
  • Hi,

    Do you have checked the ULS log?

    For SharePoint 2013, by default, ULS log locates in
    "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS"

    Or please provide some code about how to reproduce this issue, others would get easier to research on it.

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 1, 2017 2:06 AM
    Moderator
  • I checked the WSP and i found all elements features, manifest.xml and dlll... it's always absurd 
    Wednesday, February 1, 2017 10:37 AM
  • Hi Dennis,

    I checked Logs and in expected Category i found this error. i think that this error due to issue with claims to token service, so i started this service and this error is always present : 

    No windows identity for DOMAIN\svcadmin. 76ead09d-2f9e-b058-9c0e-ff33a4dfea2e
    SPSecurityContext: Could not retrieve a valid windows identity for username DOMAIN\svcAdmin' with UPN 'svcAdmin@domain.com'. UPN is required when Kerberos constrained delegation is used. Exception: System.ComponentModel.Win32Exception (0x80004005): Access is denied    Server stack trace:      at System.ServiceModel.Channels.AppContainerInfo.GetCurrentProcessToken()     at System.ServiceModel.Channels.AppContainerInfo.RunningInAppContainer()     at System.ServiceModel.Channels.AppContainerInfo.get_IsRunningInAppContainer()     at System.ServiceModel.Channels.PipeSharedMemory.BuildPipeName(String pipeGuid)     at System.ServiceModel.Channels.PipeSharedMemory.get_PipeName()     at System.ServiceModel.Channels.PipeConnectionInitiator.GetPipeName(Uri uri, IPipeTransportFactorySettings transportF... 76ead09d-2f9e-b058-9c0e-ff33a4dfea2e
    02/01/2017 17:42:26.88* w3wp.exe (0x471C)                       0x237C SharePoint Foundation         Claims Authentication         bz7l Medium   ...actorySettings)     at System.ServiceModel.Channels.NamedPipeConnectionPoolRegistry.NamedPipeConnectionPool.GetPoolKey(EndpointAddress address, Uri via)     at System.ServiceModel.Channels.CommunicationPool`2.TakeConnection(EndpointAddress address, Uri via, TimeSpan timeout, TKey& key)     at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)     at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Chann... 76ead09d-2f9e-b058-9c0e-ff33a4dfea2e
    02/01/2017 17:42:26.88* w3wp.exe (0x471C)                       0x237C SharePoint Foundation         Claims Authentication         bz7l Medium   ...els.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)     at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at ... 76ead09d-2f9e-b058-9c0e-ff33a4dfea2e
    02/01/2017 17:42:26.88* w3wp.exe (0x471C)                       0x237C SharePoint Foundation         Claims Authentication         bz7l Medium   ...System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at Microsoft.IdentityModel.WindowsTokenService.S4UClient.IS4UService_dup.UpnLogon(String upn, Int32 pid)     at Microsoft.IdentityModel.WindowsTokenService.S4UClient.CallService(Func`2 contractOperation)     at Microsoft.SharePoint.SPSecurityContext.GetWindowsIdentity(). 76ead09d-2f9e-b058-9c0e-ff33a4dfea2e
    02/01/2017 17:42:26.88 w3wp.exe (0x471C)                       0x237C SharePoint Foundation         Claims Authentication         g220 Unexpected No windows identity for DOMAIN\svcadmin. 76ead09d-2f9e-b058-9c0e-ff33a4dfea2e

    Best Regards,

    Hedi

    Wednesday, February 1, 2017 5:13 PM
  • Hi,

    Is your webpart trying to access the data outside of your SharePoint Context such as reporting or SQL table ?

    If yes , ensure the Keberos has been configured correctly.

    Did password has been expired recently for the account Domain\Svcadmin ?

    If yes, go to your IIS->Application pool ->Select SecurityTokenServiceApplication Pool->Right click and choose advanced setting and update the password for the account as shown in this image


    Please remember to click Mark as Answer on the answer if it helps you Murugesa Pandian | MCPD | MCTS |



    Wednesday, February 1, 2017 6:41 PM
  • Hi Hedi,

    Please check whether the Claims to Windows Token Service run on server or not.

    Go to central admin > manager services on server make sure Claims to Windows Token Service is running on all server in the farm. If not running start it, if running then restart them.

    Or check the blog below:

    1. Browse: C:\Program Files\Windows Identity Foundation\v3.5
    2. Edit c2wtshost.exe.config
    3. Add <add value=”NT AUTHORITY\Authenticated Users” /> to the <allowedCallers>

    http://blog.k-network.eu/2016/01/no-windows-identity-for-domainuser/

    Best Regards,

    Dennis


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, February 6, 2017 2:44 AM
    Moderator