question

Groovykool-9087 avatar image
1 Vote"
Groovykool-9087 asked Groovykool-9087 commented

Why does adding a UWP Packaging Project to a working UWP/Project/Solution cause Debug errors and exceptions?

Why does adding a UWP Packaging Project to my working UWP/Project/Solution cause Debug errors and exceptions?

Start with a working UWP Project in a solution.

Add a UWP Packaging Project to the solution.

Setup the packaging project as startup and add a reference to the UWP project.

Use the solution configuration manager to only deploy the Package Project.

Debug build.


The UWP project builds and runs.

But now I get the errors shown below. In addition XAML source paths like Source="/Styles/_Colors.xaml" are no longer valid?

Repo: https://github.com/groovykool/WTSTestExceptions.git


Thanks,
Tony


onecore\windows\directx\database\helperlibrary\lib\directxdatabasehelper.cpp(284)\dxgi.dll!61D2687D: (caller: 61D2613B) ReturnHr(1) tid(2bf8) 80070005 Access is denied.

onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!148744D2: (caller: 14874327) ReturnHr(1) tid(4be4) 80070490 Element not found.

onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!148744D2: (caller: 148741D6) ReturnHr(2) tid(4be4) 80070490 Element not found.

onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!148744D2: (caller: 14874327) ReturnHr(3) tid(4be4) 80070490 Element not found.

Exception thrown at 0x77B74192 (KernelBase.dll) in WTSTestExceptions.exe: WinRT originate error - 0x80070057 : '/Styles/_Colors.xaml is not a valid absolute URI.'.

Exception thrown at 0x77B74192 (KernelBase.dll) in WTSTestExceptions.exe: WinRT originate error - 0x80070057 : '/Styles/_FontSizes.xaml is not a valid absolute URI.'.

Exception thrown at 0x77B74192 (KernelBase.dll) in WTSTestExceptions.exe: WinRT originate error - 0x80070057 : '/Styles/_Thickness.xaml is not a valid absolute URI.'.

Exception thrown at 0x77B74192 (KernelBase.dll) in WTSTestExceptions.exe: WinRT originate error - 0x80070057 : '/Styles/TextBlock.xaml is not a valid absolute URI.'.

Exception thrown at 0x77B74192 (KernelBase.dll) in WTSTestExceptions.exe: WinRT originate error - 0x80070057 : '/Styles/Page.xaml is not a valid absolute URI.'.

onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!148744D2: (caller: 14874327) ReturnHr(4) tid(4be4) 80070490 Element not found.



windows-uwp
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, in the process of compiling and running the application, I did not reproduce this problem. Where did I get this error message? Maybe you can try to rewrite the path of the referenced file in App.xaml to: <ResourceDictionary Source="ms-appx:///Styles/_Colors.xaml">

2 Votes 2 ·

Yes that will fix the path/uri issue. But why would adding a Packaging project change how XAML reads/processes Source=uri statements?

I will try running on another system.

The errors occurred on windows 1909.

Thanks,
Tony


0 Votes 0 ·

/Style/xxx.xaml seems to be a relative path, and the packager requires an absolute path, which should be caused by the difference in path resolution. In addition, it seems that my reply solves the problem you encountered. May I turn this comment into an answer?

0 Votes 0 ·
Show more comments

1 Answer

RichardZhang-MSFT avatar image
3 Votes"
RichardZhang-MSFT answered Groovykool-9087 commented

Hello,​

Welcome to our Microsoft Q&A platform!

Combined with our previous discussion, I conducted more follow-up tests.

> '/Styles/_Colors.xaml is not a valid absolute URI.'.

The reason for this problem is that the packager requires an absolute URI, so you can modify the resource dictionary reference path in App.xaml as:

<ResourceDictionary Source="ms-appx:///Styles/_Colors.xaml">

> (caller: 14874327) ReturnHr(1) tid(4be4) 80070490 Element not found.

I reproduced this exception in the device with system 1909. When generating the PackTest project, the output window will display these error messages, although it does not affect the operation of the final application.

Besides, when I run the project in the latest preview system (the future official version number is 2004), these error messages disappear.

Thanks.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.