Question

sm_on_live on Tue, 22 Dec 2015 18:53:24


I have retargeted a Windows Phone 8 Silverlight project to WP8.1.

Besides this error, I also had to get Pivot control of Microsoft.Phone.Controls from the assembly Microsoft.Phone instead of from Microsoft.Phone.Controls assembly.

After that I am left with only this error. The following is the full Error Description:

Severity Code Description Project File Line Suppression State
Error  The "GenerateResource" task failed unexpectedly.
System.InvalidOperationException: Item named 'themes/generic.xaml' 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() MyProject

As per a solution suggested in another thread I added the following line <PropertyGroup> in MyProject.csproj file

<GenerateResourceNeverLockTypeAssemblies>true</GenerateResourceNeverLockTypeAssemblies>

This didn't help. How can get rid of this?

ThanQ...


ThanQ...


Sponsored



Replies

Jamles Hez on Wed, 23 Dec 2015 02:43:44


Hi sm_on_live,

>>I have retargeted a Windows Phone 8 Silverlight project to WP8.1.

Might need know more information for your issue, since I'm not quite sure if WP8.1 means runtime 8.1 or Silverlight 8.1? And what kind of things you have do while upgrading from WP8 to WP8.1, use the tool from Visual Studio or some third party tools?

If it works fine with previous version I would suggest you migrate again and to see the result instead of trying to fix the MSBuild error, since we will never know if we fix this, will the next come to you. If you successfully upgrade the application, everything should be fine then.

--James

Shantimohan on Wed, 23 Dec 2015 18:15:47


I right clicked on the WP 8.0 Silverlight project in Solution Explorer and selected the option "Retarget to Windows Phone 8.1". That's all. I suppose it is WP 8.1 Silverlight.

I don't if a WP 8.0 SL project can be targeted to WP 8.1 RT. I didn't use any 3rd party software to convert.

I have posted here after repeating it for 3 times.

PS: I was logged into a machine with different MS A/c id. It's me 'sm_on_live'...

Jamles Hez on Thu, 24 Dec 2015 05:40:23


Hi Shantimohan,

Why I ask how you do the migration because there is indeed some 3rd party tool that can migrate the SL to RT and they are still in the beta test. 

However I would like to know more detail of your project, as I can see from the blog:https://blogs.windows.com/buildingapps/2014/07/29/merging-the-code-base-combining-existing-windows-store-and-phone-apps-into-universal-apps/

After the retarget operation, you might (actually most definitely, if you have referenced projects or third-party packages) receive the following generic error if the referenced components are not supported on 8.1.

Perhaps you can double check if you have some controls in your package that does not supported on 8.1.

--James