Dynamics CRM 365 Business Apps Page Could Not Be Found - dynamics-crm

I am getting the following error trying to access a Business App in Chrome using MS CRM 365 (on premise version 8.2.10.24):
The page that you are looking for could not be found. This may be a temporary issue. Please try again later or contact your administrator.
If I enable tracing I find this error:
[2019-10-28 08:09:09.593] Process: w3wp |Organization:9ccba46c-953f-46ed-a842-9d57082ef828 |Thread: 145 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 0af0ff18-8d71-4149-8046-68a2fa1c54aa |ActivityId: 0af0ff18-8d71-4149-8046-68a2fa1c54aa | Util.GetBrowserReloadCountConfig ilOffset = 0x1B
Exception while getting Reload Count = System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Crm.Application.Utility.Util.GetBrowserReloadCountConfig()
[2019-10-28 08:09:09.468] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 138 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 8cbaa7b4-f4ea-4055-9c15-14739e260408 |ActivityId: 8cbaa7b4-f4ea-4055-9c15-14739e260408 | CrmHttpException..ctor ilOffset = 0x22
at CrmHttpException..ctor(HttpStatusCode statusCode, String message, Object[] args) ilOffset = 0x22
at CrmODataOptimisticConcurrencyHelper.HandleGetMatchETags(CrmODataExecutionContext context, Entity entity) ilOffset = 0x129
at CrmODataServiceDataProvider.RetrieveEntityWithRelatedRecords(CrmODataExecutionContext context, EntityReference primaryEntityReference, QueryExpression qe, RelationshipQueryCollection relatedEntitiesQuery) ilOffset = 0x19
at CrmODataServiceDataProvider.RetrieveEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, ODataQueryOptions queryOptions) ilOffset = 0x2D
at EntityController.GetEntity(String entityName, String key) ilOffset = 0x32
at ilOffset = 0xFFFFFFFF
I cannot find anything searching for either of these errors. I receive the error when clicking directly on the app under "Settings->My Apps". There are no errors or warnings when I Validate and I have also Published.
When receiving the error this is the URL: http://<servername>/<orgname>/main.aspx?appid=7c9a6213-688c-e911-80cd-00155d039508#
If I query the AppModule table that guid is in there.
Anyone have any ideas?

Something is not right. Can you try the direct url like below:
http://<servername>/<orgname>/Apps?appid=7c9a6213-688c-e911-80cd-00155d039508
Reference
• For Online users, the URL syntax is: https://<org name>.crm#.dynamics.com/Apps/<App URL>
• For On-premise users, the URL syntax is: https://<org name>/Apps/

Related

When creating an IServiceManagement for Dynamics 365, why does the authentication endpoint respond with an HTML sign in page?

I have some integration code that intends to use the Organization Service via the CRM SDK.
On one environment, creating an IServiceManagement<IOrganizationService>:
IServiceManagement<IOrganizationService> orgServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri("dynamics uri")));
and then authenticating with service account credentials:
AuthenticationCredentials authCredentials = new AuthenticationCredentials();
authCredentials.ClientCredentials.UserName.UserName = _config.GetValue<string>("Dynamics:Username");
authCredentials.ClientCredentials.UserName.Password = _config.GetValue<string>("Dynamics:Password");
AuthenticationCredentials tokenCredentials = orgServiceManagement.Authenticate(authCredentials);
works fine.
On another Dynamics environment, the call to GetServiceManagement fails with the following error message:
System.InvalidOperationException
HResult=0x80131509
Message=Metadata contains a reference that cannot be resolved: 'https://login.microsoftonline.com/[guid]/oauth2/authorize?client_id=[some client id]&response_mode=form_post&response_type=code+id_token&scope=openid+profile&state=OpenIdConnect.AuthenticationProperties%[some base-64]RedirectTo%3dhttps%253a%252f%252ftst-success.crm4.dynamics.com%252f&nonce=[some nonce]&redirect_uri=https:%2f%2fcloudredirector.crm4.dynamics.com%2fG%2fAuthRedirect%2fIndex.aspx&max_age=86400'.
Source=System.ServiceModel
StackTrace:
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.ResolveNext(ResolveCallState resolveCallState)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(MetadataRetriever retriever)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(Uri address, MetadataExchangeClientMode mode)
at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata(Type contractType, Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateConfiguration[TService](Uri serviceUri)
at CrmAuthTest.Program.Main(String[] args) in c:\users\t.wolverson\Source\Repos\CrmAuthTest\CrmAuthTest\Program.cs:line 18
Inner Exception 1:
XmlException: CData elements not valid at top level of an XML document. Line 1, position 3.
(I have masked the bits which look identifying or cryptographic)
POSTing to this URL in PostMan yields the HTML for a browser login page, which explains the failure; this isn't what the ServiceConfigurationFactory expects. The scenario is not user-interactive, so this would never make sense, there is no browser and no user able to interact with it.
What do I have to change in Dynamics CRM Online to stop it doing this, and make it just work normally?
Do you instantiate your OrganizationServiceProxy depending on the AuthenticationProviderType right after the lines of code you have posted? Like this
var orgServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(ConfigurationManager.AppSettings["CrmUrlService"]));
var authCredentials = new AuthenticationCredentials();
authCredentials.ClientCredentials.UserName.UserName = ConfigurationManager.AppSettings["CrmUserName"];
authCredentials.ClientCredentials.UserName.Password = ConfigurationManager.AppSettings["CrmPassword"];
var tokenCredentials = orgServiceManagement.Authenticate(authCredentials);
IOrganizationService _service;
switch (orgServiceManagement.AuthenticationType)
{
case AuthenticationProviderType.ActiveDirectory:
_service = new OrganizationServiceProxy(orgServiceManagement, tokenCredentials.ClientCredentials);
break;
default:
_service = new OrganizationServiceProxy(orgServiceManagement, tokenCredentials.SecurityTokenResponse);
break;
}
Even if this solves your problem, I recommend that you use CrmServiceClient instead. This class can be found in Microsoft.Xrm.Tooling.Connector dll. It is the go to authentication class when building Windows client applications that connect to Microsoft Dynamics 365. More information on this can be found here
Here is an example on how to initialize CrmServiceClient when connecting to Dynamics 365 online using Office 365:
var myConnectionString = "Url=https://[YourOrganization].crm4.dynamics.com;Username=[YourUser];Password=[YourPassword];AuthType=Office365;";
var crmClient = new CrmServiceClient(myConnectionString);
//Do your stuff
var response = crmClient.Execute(new WhoAmIRequest());
If you need other authentication methods in Dynamics Online check how to build your connection string here.
For on-premises check how to build your connection string here.

Exception in SubscribeToStreamingNotifications

I'm getting mailbox exception for quite some time now, not even once was the streaming subscription made successfully since the last month.
Exception:
Can't connect to the mailbox of user Mailbox database guid: 67f43d90-xxxx-xxxx-xxxx-7a296a993f38 because the ExchangePrincipal object contains outdated information. The mailbox may have been moved recently.
My code to create subscription:
private void CreateSubscription()
{
var events = new List<EventType>
{
EventType.NewMail,
EventType.Created,
EventType.Deleted,
EventType.Modified,
EventType.Moved,
EventType.Copied,
EventType.FreeBusyChanged
};
if (_subscription != null)
{
((StreamingSubscription)_subscription).Unsubscribe();
_connection.RemoveSubscription((StreamingSubscription)_subscription);
}
_subscription = _exchange.SubscribeToStreamingNotifications(subscriptionFolders, events.ToArray());
_connection.AddSubscription((StreamingSubscription)_subscription);
if (stopwatch.IsRunning)
{
stopwatch.Restart();
var e = stopwatch.ElapsedMilliseconds;
logger.LogFatal($"Stopwatch restarted: {e}");
}
else
{
stopwatch.Start();
var e = stopwatch.ElapsedMilliseconds;
logger.LogFatal($"Stopwatch started: {e}");
}
}
The exception occurs at the following line:
_subscription = _exchange.SubscribeToStreamingNotifications(subscriptionFolders, events.ToArray());
Stacktrace:
Microsoft.Exchange.WebServices.Data.ServiceResponseException: The specified object was not found in the store., Can't connect to the mailbox of user Mailbox database guid: 67f43d90-xxxx-xxxx-xxxx-7a296a993f38 because the ExchangePrincipal object contains outdated information. The mailbox may have been moved recently.
at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.SubscribeToStreamingNotifications(IEnumerable`1 folderIds, EventType[] eventTypes)
at Mach.Omega.EwsClient.WinService.Classes.ExchangeServiceClient.CreateSubscription() in D:\Sourcecode\Mach.Omega\Sourcecode\Mach.Omega.EwsClient.WinService\Mach.Omega.EwsClient.WinService\Classes\ExchangeServiceClient.cs:line 172
at Mach.Omega.EwsClient.WinService.Classes.ExchangeServiceClient.CreateSubscription(IEnumerable`1 subscriptionFolders) in D:\Sourcecode\Mach.Omega\Sourcecode\Mach.Omega.EwsClient.WinService\Mach.Omega.EwsClient.WinService\Classes\ExchangeServiceClient.cs:line 131
at Mach.Omega.EwsClient.WinService.Classes.SubcriptionProcess.Subscribe() in D:\Sourcecode\Mach.Omega\Sourcecode\Mach.Omega.EwsClient.WinService\Mach.Omega.EwsClient.WinService\Classes\SubcriptionProcess.cs:line 154
at Mach.Omega.EwsClient.WinService.EwsService.SubscriptionWorker() in D:\Sourcecode\Mach.Omega\Sourcecode\Mach.Omega.EwsClient.WinService\Mach.Omega.EwsClient.WinService\EwsService.cs:line 200
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
Please note that I am able to fetch emails from the mailbox just fine, but cannot create the streaming subscription.
Is this OnPrem or Office365 ? as a generally rule you should always use the X-AnchorMailbox header https://blogs.msdn.microsoft.com/webdav_101/2018/06/16/best-practices-important-and-critical-headers-for-ews/, that error indicates a routing issue or stale directory information (potentially caused by replication issues in AD). If its Office365 try the MailboxGUID as the X-AnchorMailbox https://developer.microsoft.com/en-us/office/blogs/error-improvement-for-invalid-x-anchormailbox-in-rest-api-calls/

How disable location in Xamarin.Forms UI Test

How can I disable location while single UI test in xamarin forms (I am using Android 8.1 simulator)? In one test case I want cancel location permission, and in other simulate that the GPS can not find user location.
I thought about backdors, but I did not found nothing useful or up to date on msdn and stack (some links pasted bellow).
I have tried something like this (and much more similar 'mutations'):
Droid.MainActivity:
[Export("GpsBackdoor")]
public void GpsBackdoor()
{
Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
intent.PutExtra("enabled", Java.Lang.Boolean.False);
SendBroadcast(intent);
}
UITests.Test:
[Test]
public void SetCurrentUserLocation_WhenGPSisOff_ShouldShowAlert()
{
app.WaitForElement(x => x.Text("Nearest stops"));
app.Invoke("GpsBackdoor");
app.Tap(x => x.Text("Nearest stops"));
var result = app.WaitForElement("Could not obtain position");
}
After running test I am getting message:
System.Exception : Error while performing Invoke("GpsBackdoor", null)
----> System.Net.Http.HttpRequestException : An error occurred while sending
the request.
----> System.Net.WebException : The underlying connection was closed: The
connection was closed unexpectedly.
at Xamarin.UITest.Utils.ErrorReporting.With[T](Func`1 func, Object[] args,
String memberName)
at Xamarin.UITest.Android.AndroidApp.Invoke(String methodName, Object
argument)
at BusMap.Mobile.UITests.NearestStopsMapPageTests.
SetCurrentUserLocation_WhenGPSisOff_ShouldShowAlert() in
<source>\NearestStopsMapPageTests.cs:line 40
--HttpRequestException
at Xamarin.UITest.Shared.Http.HttpClient.SendData(String endpoint, String
method, HttpContent content, ExceptionPolicy exceptionPolicy, Nullable`1
timeOut)
at Xamarin.UITest.Shared.Http.HttpClient.Post(String endpoint, String
arguments, ExceptionPolicy exceptionPolicy, Nullable`1 timeOut)
at Xamarin.UITest.Android.AndroidGestures.Invoke(String methodName, Object[]
arguments)
at Xamarin.UITest.Utils.ErrorReporting.With[T](Func`1 func, Object[] args,
String memberName)
--WebException
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
I've also tried turn off Wifi or cellular data, which gave me the same error.
I will be grateful for any help.
P.S. Some links which I've found:
Enable/Disable wifi using Xamarin UiTest
How to start GPS ON and OFF programatically in Android

CrmServiceClient is always returning null Organization Service

I've got the following code to connect to Dynamics 365 Online organization. It throws a null reference exception on orgService.Execute(new WhoAmIRequest()); and error log is below the code. I've tried this on two machines with different console apps. I've tried both the 8.2 and 8.0 SDK DLLs. If I rewrite this using CrmConnection with the 7.x SDK DLLs everything works fine. I can browse to the organization using the same credentials (cut & pasted to be sure there is not a typo.)
The connection string format is taken from the example at https://msdn.microsoft.com/en-us/library/mt608573.aspx:
Named account using Office 365
<add name="MyCRMServer"
-connectionString="AuthType=Office365;Username=jsmith#contoso.onmicrosoft.com;
Password=passcode;Url=https://contoso.crm.dynamics.com"/>
The basic code.
var connectionString = #"Url=https://ORGNAME.crm.dynamics.com; Username=username#ORGNAME.onmicrosoft.com; Password=43JF##$j##Ha; Authype=Office365;";
var client = new CrmServiceClient(connectionString);
var orgService = (IOrganizationService)client.OrganizationWebProxyClient ?? client.OrganizationServiceProxy;
orgService.Execute(new WhoAmIRequest());
Error log output:
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : Discovery URI is = https://ORGNAME.crm.dynamics.com:443/XRMServices/2011/Discovery.svc
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : DiscoverOrganizations - Initializing Discovery Server Object with https://ORGNAME.crm.dynamics.com/XRMServices/2011/Discovery.svc
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : DiscoverOrganizations - attempting to connect to CRM server # https://ORGNAME.crm.dynamics.com/XRMServices/2011/Discovery.svc
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Source : System.ServiceModel
Method : Retrieve
Date : 2/13/2017
Time : 5:42:37 PM
Error : Metadata contains a reference that cannot be resolved: 'https://ORGNAME.crm.dynamics.com/_common/error/errorhandler.aspx?BackUri=&ErrorCode=&Parm0=%0d%0a%0d%0aتفاصيل الخطأ: The service '%2fXRMServices%2f2011%2fDiscovery.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'Microsoft.Crm.Site.Services%2c Version%3d8.0.0.0%2c Culture%3dneutral%2c PublicKeyToken%3d31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..&RequestUri=%2fXRMServices%2f2011%2fDiscovery.svc%3fwsdl%26sdkversion%3d8.1&user_lcid=1025'.
Stack Trace : at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.ResolveNext(ResolveCallState resolveCallState)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(MetadataRetriever retriever)
at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(Uri address, MetadataExchangeClientMode mode)
at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata(Type contractType, Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateManagement[TService](Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)
at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateManagement[TService](Uri serviceUri)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.CreateAndAuthenticateProxy[T](IServiceManagement`1 servicecfg, Uri ServiceUri, Uri homeRealm, ClientCredentials userCredentials, ClientCredentials deviceCredentials, String LogString)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverOrganizations(Uri discoveryServiceUri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverOrganizations(Uri discoveryServiceUri, Uri homeRealmUri, NetworkCredential networkCredential)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.InitCRM2011Service()
======================================================================================================================
Inner Exception Level 1 :
Source : System.Runtime.Serialization
Method : ThrowXmlException
Date : 2/13/2017
Time : 5:42:37 PM
Error : CData elements not valid at top level of an XML document. Line 1, position 3.
Stack Trace : at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, XmlException exception)
at System.Xml.XmlUTF8TextReader.Read()
at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.GetXmlReader(HttpWebResponse response, Int64 maxMessageSize, XmlDictionaryReaderQuotas readerQuotas)
at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
======================================================================================================================
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Unable to Login to Dynamics CRM
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : OrganizationWebProxyClient is null
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : OrganizationServiceProxy is null
As per latest Microsoft recommendation we are not supposed to use “AuthType=Office365”.
https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/authenticate-office365-deprecation
We can use Application Account (Client ID & Secret Key) to generate Token & access Dynamics CRM Organization Service. But if you want to use User ID & PWD then Use (AuthType = OAuth)
Sample Code :
string connectionString = "AuthType = OAuth; Url = 'https://*****.crm.dynamics.com'; Username = '*******'; Password = '*******'; AppId = 51f81489-12ee-4a9e-aaae-a2591f45987d; RedirectUri = app://58145B91-0C36-4500-8554-080854F2AC97;LoginPrompt=Never";
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
CrmServiceClient crmServiceClient = new CrmServiceClient(connectionString);
WhoAmIResponse whoAmIResponse = crmServiceClient.Execute(new WhoAmIRequest()) as WhoAmIResponse;
Note : While trying to use this from Azure Function I got below errors :
ERROR REQUESTING Token FROM THE Authentication contextNeed a non-empty authority
One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostERROR REQUESTING Token FROM THE Authentication context
CurrentAccessToken = 'crmServiceClient.CurrentAccessToken' threw an exception of type 'System.NullReferenceException'
Easily you can resolve these using just one additional line : ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Ref URL : https://support.microsoft.com/en-us/help/4051700
Microsoft Dynamics 365 Customer Engagement (online) to require TLS 1.2 for connectivity
Pls let me know if you are facing any other issues.
Thanks,
Sumit
Have you tried passing the parameters directly to the CrmServiceClient instead of the connection string?
I can connect successfully to Dynamics365 by using this following method
public CrmServiceClient(string crmUserId, SecureString crmPassword, string crmRegion, string orgName, bool useUniqueInstance = false, bool useSsl = false, OrganizationDetail orgDetail = null, bool isOffice365 = false);
And here's how I applied
var pwd = ConvertToSecureString("userpassword");
CrmServiceClient client = new CrmServiceClient("user#mail.com", pwd, "NorthAmerica", "orgname", isOffice365: true);
And here's the method to convert the password to secure string
private System.Security.SecureString ConvertToSecureString(string password)
{
if (password == null)
throw new ArgumentNullException("missing pwd");
var securePassword = new System.Security.SecureString();
foreach (char c in password)
securePassword.AppendChar(c);
securePassword.MakeReadOnly();
return securePassword;
}
I was getting error
Unable to login to Dynamics CRM, Error was :
Data[0] = "The provided uri did not return any Service Endpoints!
I received this error when attempting to connect to Dynamics using a connection string with AuthType=ClientSecret. Previously I was connecting successfully using username and password with a connection string of the form
"Url={dynamicsConnectionString};Username={username};Password={password};AuthType=Office365;"
The connection string was changed to have the form
"AuthType=ClientSecret;RequireNewInstance=false;Url={CrmDynamicsPrivatePrimaryConnection};ClientId={CrmDynamicsPrivateClientId};ClientSecret={CrmDynamicsPrivateClientSecret};LoginPrompt=Never;"
The error occurred because I was using an outdated version of Microsoft.CrmSdk.XrmTooling.CoreAssembly. I was using version 9.0.2.27, and according to a web report, version 9.1.0.13 is needed for connecting with ClientSecret. I updated to version 9.1.0.68 using NuGet, and the Dynamics connection worked.
I was struggling on fixing this issue because everything I did except installing higher version (On MS docs also They didn't mentioned this) of Microsoft.CrmSdk.XrmTooling.CoreAssembly since lower version of this dll doesn't support ClientSecret authentiation.

Use of undefined keyword value 1 for event TaskScheduled

When debugging my universal Windows (8.1) app i encounter the following error from time to time:
System.ArgumentException was unhandled
_HResult=-2147024809
_message=Use of undefined keyword value 1 for event TaskScheduled.
HResult=-2147024809
IsTransient=false
Message=Use of undefined keyword value 1 for event TaskScheduled.
Source=mscorlib
StackTrace:
at System.Diagnostics.Tracing.ManifestBuilder.GetKeywords(UInt64 keywords, String eventName)
at System.Diagnostics.Tracing.ManifestBuilder.StartEvent(String eventName, EventAttribute eventAttribute)
at System.Diagnostics.Tracing.EventSource.CreateManifestAndDescriptors(Type eventSourceType, String eventSourceDllName, EventSource source)
at System.Diagnostics.Tracing.EventSource.EnsureInitialized()
at System.Diagnostics.Tracing.EventSource.SendCommand(EventListener listener, Int32 perEventSourceSessionId, Int32 etwSessionId, EventCommand command, Boolean enable, EventLevel level, EventKeywords matchAnyKeyword, IDictionary`2 commandArguments)
at System.Diagnostics.Tracing.EventSource.OverideEventProvider.OnControllerCommand(ControllerCommand command, IDictionary`2 arguments, Int32 perEventSourceSessionId, Int32 etwSessionId)
at System.Diagnostics.Tracing.EventProvider.EtwEnableCallBack(Guid& sourceId, Int32 controlCode, Byte setLevel, Int64 anyKeyword, Int64 allKeyword, EVENT_FILTER_DESCRIPTOR* filterData, Void* callbackContext)
I can then skip this error and am able to proceed using the app in debug mode but when installed on a device the app will crash.
I have searched for an answer for some time now but the only answer i have come across here is to disable breaking on these kind of exceptions which is of course not a very good answer.
Thanks in advance.
EDIT 1:
Ok, i have a very simple sample project with which this error is easily reproduced. I created a Universal App Blank app in Visual Studio 2013 Ultimate and added the following code to the App.xaml.cs.
The exception posted above is raised on the line with await.
Can anybody help because this is plagueing me for months now.
public App()
{
this.InitializeComponent();
this.Suspending += this.OnSuspending;
callService();
}
async public Task callService()
{
string url = "http://eu.battle.net/api/d3/profile/bunnynut-2128/";
HttpClient client = new HttpClient();
string data = await client.GetStringAsync(url);
client.Dispose();
}

Resources