Halid
Halid

Reputation: 448

WPF to UWP Visual Studio conversion build error

im following this msdn tutorial to covert my WPF to UWP

I go this build error when trying to build the app.

Severity    Code    Description Project File    Line    Suppression State
Error   MSB4018 The "GenerateResource" task failed unexpectedly.
System.InvalidOperationException: Item named 'themes/lightbrushes.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.ITaskExecution
Host.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.
<ExecuteInstantiatedTask>d__26.MoveNext()   Deployment.Bridge   C:\Program 
Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets    1251    

Note that 'themes/lightbrushes.baml' is not part of the app files Any help is greatly appreciated

Upvotes: 1

Views: 161

Answers (1)

rido
rido

Reputation: 1242

I've seen a similar behavior while trying to convert satellite assemblies to PRIs.

You can try to disable this adding the next property to your jsproj file:

 <AppxGeneratePrisForPortableLibrariesEnabled>false</AppxGeneratePrisForPortableLibrariesEnabled>

Upvotes: 1

Related Questions