Archive

Posts Tagged ‘Debugging’

Developing Windows 8 – Unable to activate Windows Store app

April 16, 2013 Leave a comment

I have encountered the following error several times and I am sure that I will continue to encounter it in the future.

Unable to activate Windows Store app.  The activate request failed with error ‘This app failed to launch because of an issue with its license.  Please try again in a moment.’

Unable to activate Windows Store app

If you come across this error when you fire up Visual Studio, you may end up doing a lot of things to try to resolve the problem.  Several that come to mind are:

  • Re-starting Windows
  • Re-starting Visual Studio
  • Modifying your package manifest

None of these actually fix them problem.  It turns out that the majority of time that you encounter this problem is because you have already installed the solution into start screen.  I would recommend that anytime you encounter this error, that you always first uninstall the application from the start screen and then try to run it from Visual Studio again.

Hope this helps…

Categories: English Tags: , , , , ,

Registration of the app failed

September 10, 2012 1 comment

Recently, I have been playing with a lot of sample code on Windows 8 development and I have ran into a couple of issues while trying to get the demos or code that I have written on another computer to run.  As soon as you try to run the application, you get the following exception:

Error: DEP0700: Registration of the app failed.  An internal error occurred with error 0x80073D05.  See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.

Here is a screen shot of the same:

If you haven’t worked a lot with Windows 8, you may not where to look as far as correcting this error.  If you take a look at the package.appxmanifest file in Visual Studio 2012 and go to the Packaging tab, you will see the following:

I discovered that if you change the certificate associated with the application, you can fix the problem.  Simply click on the “Choose Certificate…” button and you will see the following pop-up:

Next click on the “Configure Certificate…” drop-down and chose “Create Test Certificate…” and you will see the following pop-up:

Once you have done this, you should be able to run your application successfully.

Alternatives:

  • I read another post, that mentioned that if you log-out and log back in, you can then run the application without any issues.
  • I found this post on the msdn forums that mentioned if you changed the package identity, things would work.  However, according to here, your package name is unique to your Windows Store developer account and I don’t think it is a good idea to change it.

Hope this helps…

The type DomainContext does not expose a method called ‘GetCustomer2Query’

May 26, 2010 1 comment

This error message was a common one that I was receiving when I switched from Linq2Sql to Linq2Entities. The reason behind this was that Linq2Sql pluralized my data model and so I was trying to look for the same corresponding query for Linq2Entities exposed by WCF RIA Services.

Here is the Xaml that causes the problem. It is valid Xaml but you will get a runtime error:

<UserControl
    x:Class="SampleView"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:riaCtls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
    >
    <Grid >
        <riaCtls:DomainDataSource x:Name="_dds"
            QueryName="GetCustomer2Query"
            AutoLoad="False" PageSize="25" LoadSize="100"
            DomainContext="{Binding DomainContext, Mode=TwoWay}" />

        ...

    </Grid>
</UserControl>

At runtime, you will get the following error:

The type DomainContext does not expose a method called ‘GetCustomer2Query’

This message is simple to fix, all I did was correct the query as you can see below:

<UserControl
    x:Class="SampleView"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:riaCtls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
    >
    <Grid >
        <riaCtls:DomainDataSource x:Name="_dds"
            QueryName="GetCustomerQuery"
            AutoLoad="False" PageSize="25" LoadSize="100"
            DomainContext="{Binding DomainContext, Mode=TwoWay}" />

        ...

    </Grid>
</UserControl>

The subtle difference is in the actual name of the query. This could be a blatant error or something as subtle as pluralization.

As a side note, the word “Query” can be ommitted. WCF RIA Services will honor the query name regardless.

Hope this helps…

Modifying a column with the Identity pattern is not supported.

In doing some testing today, I came across a wierd scenario with using WCF RIA Services on top of the Entity Framework. I was testing a Site table that had the following data definition:

CREATE TABLE Site
(
	  SiteIdent int identity NOT NULL
	, SiteKey varchar(4) primary key NOT NULL
	, MinimumPasswordLength int NOT NULL
	, RequirePasswordAuthentication bit NOT NULL
)

When I tried to make a modification to an existing record, I received the message in the title of my post:

“Modifying a column with the Identity pattern is not supported.”

One thing to note, I saw several other posts stating that this works with Entity Framework outside of WCF RIA Services. I verified that the StoreGeneratedPattern was set to “Identity” but it did not help. I also saw an entry in the msdn forums talking about creating a custom attribute.

Because I have control of the database, I made the following change to the data model to correct the issue:

CREATE TABLE Site
(
	  SiteIdent int identity primary key NOT NULL
	, SiteKey varchar(4) NOT NULL
	, MinimumPasswordLength int NOT NULL
	, RequirePasswordAuthentication bit NOT NULL
) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_Site0] ON [dbo].[Site]
(
	[SiteKey] ASC
) ON [PRIMARY]

It is curious since I did not encounter this problem when I had previously used RIA Services on top of Linq2Sql. I am sure that there are several ways to resolve this issue but I wanted to show one way to getting past this issue.

Hope this helps….

Load operation failed for query ‘Getcustomer’. The metadata stored by the ObjectContext is different than the metadata stored by the ObjectContext’s connection. This can happen if the connection string is changed after the ObjectContext is created.

May 25, 2010 1 comment

This exception goes hand in hand with my previous blog posts on dynamically changing the connection string in Entity Framework. If you override CreateObjectContext(), you need to be sure that you don’t first create an instance of your entities and then try and pass in the connection string by setting the property.

The following is an example of what will cause the exception:

protected override CustomerEntities CreateObjectContext()
{
    string connectionString = ...
    ...
    ctx = new GrantsManagementEntities();
    ctx.Connection.ConnectionString = connectionString;

    return ctx;
}

Assuming we had a valid connection string, you would get the exception as listed in the title of this post.

The way to correct this issue is to do the following:

protected override CustomerEntities CreateObjectContext()
{
    string connectionString = ...
    ...
    ctx = new GrantsManagementEntities(connectionString);

    return ctx;
}

This allows for having dynamic connection strings on your WCF RIA Service.

Hope this helps…

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

May 25, 2010 15 comments

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

I wanted to share some bad with the good. I typically have a WCF RIA Services Class Library for every logical line of business in my enterprise application. With that said, I tend to have several libraries that are dedicated to different modules in my application.

When you create a new WCF RIA Services class library, it creates two projects. You get a project for the client and one for hosting the data access. One of the common mistakes I can make is to forget to copy the connection string information from the web project to the underlying hosting web application.

The title of this blog is the message from the exception that gets thrown if you forget to add the connection string entry in the underlying hosting web application web.config file.

This may not solve all of your problems with this exception but it is one to thing to remember.