Windows 8 metro style app test throws "The process has no package identity"

I have a problem running a test when referencing a metro style app.  When I run the test I get -

System.InvalidOperationException
The process has no package identity. (Exception from HRESULT: 0x80073D54)
   at Windows.ApplicationModel.Resources.ResourceLoader..ctor()

This is similar to the problem outlined in this thread http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/15d98c5b-2aaf-4ecf-9d62-120b91a22966/ where hamling-ling was also getting the error "The process has no package identity." when attempting to run his test from the command line.

But in my case I am trying to run an NUnit test from within a Resharper test window.
So similar to hamling-ling -

1) I have a class library (A.dll) that accesses a resw file.
2) I also have a test project (produces TestA.dll) to test the A.dll.

The exception is occurring on the constructor of the ResourceLoader() -
  private ResourceLoader _resourceLoader = new ResourceLoader();

I tried creating the store package
(right-click on the test project > Store > Create App Packages... > Local)

Then running certutil on the MYCOMPANY.Tests_1.0.0.0_AnyCPU.cer certificate file that was created in the package -

certutil -addstore root C:\lsl\ehuna\MYTEAM\Dev\Source\Tests\MYCOMPANY.Tests\AppPackages\MYCOMPANY.Tests_1.0.0.0_AnyCPU_Test\MYCOMPANY.Tests_1.0.0.0_AnyCPU.cer

but that did not help.

I was hoping someone testing Windows 8 metro-style apps and using the Resharper 7.1 test runner in VS 2012 ran into the same issue and figured it out.
Does anyone know what I need to do to get this working?

I'm using -
  Windows 8 Pro
  Visual Studio 2012 Ultimate
  NUnit 2.6.1
  Resharper 7.1

I cross posted on the Microsoft forums - http://social.msdn.microsoft.com/Forums/en-US/toolsforwinapps/thread/449635cd-6aad-4d89-95a7-be7444d48f98 - since there's some overlap on the supported products.

2 comments
Comment actions Permalink

Hello Emmanuel,

Thank you for the report. Could you please try to donwload and install fresh ReSharper 7.1 EAP build from here: http://confluence.jetbrains.net/display/ReSharper/ReSharper+7.1+Nightly+Builds.
Please let me know if it helps.

Thank you in advance!

0
Comment actions Permalink

I ended up removing the ResourceLoader() and loading my strings from the app; in the test I just faked the strings.  Sorry I can't tell you if the latest works - but I had to move forward.
I am experience issues when writing an async test that calls methods in a windows 8 library with 'await' - I'll enter another ticket on that.

0

Please sign in to leave a comment.