Code Monkey home page Code Monkey logo

Comments (23)

tseifried avatar tseifried commented on May 10, 2024 2

Thanks for your suggestions.
@vladimp: I do not have a reference into such an assembly in the project. I have not checked namespaces though.

However, I tried removing files from the win32 folder until the error disappeared.
It could be multiple files can cause this, but after I have removed Prism.Wpf.dll (file version 6.1.0.0) the build was successful. If I add it again I get the following (very similar) build error. So it might be that this is not the only file that can cause that error:

Error MSB4018 The "GenerateResource" task failed unexpectedly.
System.InvalidOperationException: Item named 'interactivity/defaultpopupwindows/defaultnotificationwindow.baml' of type 'System.IO.UnmanagedMemoryStream' cannot be added to the resource file because it is not serializable.
...

Any ideas?

from desktopbridgetouwp-samples.

vladimp avatar vladimp commented on May 10, 2024 1

Hi Guys,

Thanks for your feedback and sorry for your experience.
We didn't abandon you, we are working on creating a detailed guidance for all projects variations so you will have a great experience.
Currently it is not supported in the VS out of the box.

if you are blocked on submitting your app to the store please shoot me an email - vladimp [at] Microsoft.

Thanks for the patience and great holidays!
Vlad

from desktopbridgetouwp-samples.

tseifried avatar tseifried commented on May 10, 2024 1

Hi vlad,

Thanks for the examples. I tried to port our WPF app using the DesktopBridgeToUWP example, however a rather cryptic error happens when building the JavaScript UWP project:

Error	MSB4018	The "GenerateResource" task failed unexpectedly.

System.InvalidOperationException: Item named 'crashdialog.baml' of type 'System.IO.UnmanagedMemoryStream' cannot be added to the resource file because it is not serializable.
  at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(ReaderInfo reader, IResourceWriter writer)
  at Microsoft.Build.Tasks.ProcessResourceFiles.WriteResources(ReaderInfo reader, String filename)
  at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFileOrDir)
  at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List'1 inputs, List'1 satelliteInputs, List'1 outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass, Boolean extractingResWFiles, String resWOutputDirectory)
   at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, List'1 inputs, List'1 satelliteInputs, List'1 outputs, Boolean sourcePath, String language, String namespacename, String resourcesNamespace, String filename, String classname, Boolean publicClass, Boolean extractingResWFiles, String resWOutputDirectory)
   at Microsoft.Build.Tasks.GenerateResource.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	myapp.Package	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets	1194

Any ideas what could cause such an error?

Btw. The example works fine on that machine and I am using VS 2017 RC. Also, if I go the full manual way (using makeappx) it does create an appx file.

from desktopbridgetouwp-samples.

tseifried avatar tseifried commented on May 10, 2024 1

I have some more diagnostics on that now. I enabled more verbose msbuild output:

--snip--
1>Target _GeneratePrisForPortableLibraries:
1>  Using "RemovePayloadDuplicates" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.Build.AppxPackage.dll".
1>  Task "RemovePayloadDuplicates"
1>  Done executing task "RemovePayloadDuplicates".
1>  Using "GenerateResource" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1>  Task "GenerateResource"

1>    resgen.exe /useSourcePath /compile "c:\users\thoma\documents\visual studio 2017\Projects\Appx.Packages\MyApp.Package\win32\Prism.Wpf.dll"
1>    Extracting .ResW files from assembly "c:\users\thoma\documents\visual studio 2017\Projects\Appx.Packages\MyApp.Package\win32\Prism.Wpf.dll" into "bld\Debug\".

1>    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(1194,5): error MSB4018: The "GenerateResource" task failed unexpectedly.
      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(1194,5): error MSB4018: System.InvalidOperationException: Item named 'interactivity/defaultpopupwindows/defaultnotificationwindow.baml' of type 'System.IO.UnmanagedMemoryStream' cannot be added to the resource file because it is not serializable.
--snip--

So the error has something to do with resgen trying to extract resources from the assembly. Is this step necessary or even useful for converted desktop apps?

BTW. Please tell me if I should raise this issue somewhere else than here.

Thanks!

from desktopbridgetouwp-samples.

ridomin avatar ridomin commented on May 10, 2024 1

Hi @tseifried . While we continue investigating this issue to provide a better answer, there is a temp workaround disabling the resource generator step. To do so, just add this property to your jsproj:

  <AppxGeneratePrisForPortableLibrariesEnabled>false</AppxGeneratePrisForPortableLibrariesEnabled>

from desktopbridgetouwp-samples.

vladimp avatar vladimp commented on May 10, 2024 1

Please follow the guidance here - https://msdn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net
To publish and debug your desktop bridge application with Visual Studio.

from desktopbridgetouwp-samples.

nikz-codes avatar nikz-codes commented on May 10, 2024

I also ran into the same problem and I'm looking for a solution. This happens even with the provided AppServiceBridgeSample...

from desktopbridgetouwp-samples.

Andi55 avatar Andi55 commented on May 10, 2024

Hi nikizh,
did you find a solution for the problem? I am still searching...

from desktopbridgetouwp-samples.

nikz-codes avatar nikz-codes commented on May 10, 2024

@Andi55 No, unfortunately I didn't find a way...

@vladimp Any suggestions?
Thanks

from desktopbridgetouwp-samples.

vladimp avatar vladimp commented on May 10, 2024

Thanks for the feedback guys.
We are investigating the issue, please hold tight.

Thanks,
Vlad

from desktopbridgetouwp-samples.

jacano avatar jacano commented on May 10, 2024

Hi @vladimp,
did you find a solution for the problem? Hit the same error here.

from desktopbridgetouwp-samples.

qowognssla avatar qowognssla commented on May 10, 2024

me too...

from desktopbridgetouwp-samples.

arpadbarta avatar arpadbarta commented on May 10, 2024

Guys common... you put out a sample that you don't even try to package and then just abandon it! πŸ‘Ž Job well done...

from desktopbridgetouwp-samples.

ridomin avatar ridomin commented on May 10, 2024

Can you try to set your Win32 binaries in a subfolder of the root Appx Layout?
We have updated our Samples and verified package generation in debug and release.

from desktopbridgetouwp-samples.

arpadbarta avatar arpadbarta commented on May 10, 2024

I think we have 2 scenarios here:

  1. Win32 + UWP with app service
  2. Win32 packaged

The second options indeed creates packages however still fails to install, the first one fails with generating the package... Either way I don't consider any of them as working samples, not to mention the chosen workaround for the second option.

from desktopbridgetouwp-samples.

ridomin avatar ridomin commented on May 10, 2024

Can you provide more details on what's not working? Which are the errors?

from desktopbridgetouwp-samples.

arpadbarta avatar arpadbarta commented on May 10, 2024

We are talking inside a github issue, what would be the point to copy paste the same error message here. I don't want to be mean, if it was a third party repo I would understand, but 2 months have past and we are still "holding tight" ...

from desktopbridgetouwp-samples.

vladimp avatar vladimp commented on May 10, 2024

Hi Arpad,

We published an update few days ago that shows how to package the project in each step along the bridge, please try it out - https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/JourneyAcrossTheBridge
As a workaround we are using a JavaScript UWP project to prepare your app for the store.
You can find more details in the README file for the JourneyAcrossTheBridge samples.

We will also publish a step by step document that will walk you through building your own app very soon. if you are still blocked please email me directly to vladimp [at] Microsoft and I will help you.

Thanks!
Vlad

from desktopbridgetouwp-samples.

ridomin avatar ridomin commented on May 10, 2024

Which files are in your "win32" folder? I wonder why a .baml file shows up. Are you marking that file intentionally as part of your output? If we could see the solution, that would help.

from desktopbridgetouwp-samples.

vladimp avatar vladimp commented on May 10, 2024

Also, a similar issue issue was reported here - https://social.msdn.microsoft.com/Forums/windowsapps/en-US/0e71a593-5976-4b12-ab46-2949d3cc7baf/windows-phone-81-generateresourse-task-failed-error?forum=wpdevelop
Can you please validate whether you have a reference to - "System.Windows.Controls*" in your project?

from desktopbridgetouwp-samples.

tseifried avatar tseifried commented on May 10, 2024

Thanks! That worked for me.

from desktopbridgetouwp-samples.

xiaoliwe avatar xiaoliwe commented on May 10, 2024

please let me see your AppxManifest file
thanks a lot

from desktopbridgetouwp-samples.

Mryanxh avatar Mryanxh commented on May 10, 2024

1>MakeAppx : error : Manifest validation error: Line 36, Column 52, Reason: The file name "MainPage.xaml" declared for element "[local-name()='Applications']/[local-name()='Application']/[local-name()='Extensions']/[local-name()='Extension']" doesn't exist in the package.
1>MakeAppx : error : Package creation failed.
1>MakeAppx : error : 0x80080204 - The specified package format is not valid: The package manifest is not valid.
I don't know why

from desktopbridgetouwp-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.