Xamarin “GenerateResourceDesigner” task failed unexpectedly and .dll file could not be found

最后都变了- 提交于 2020-01-04 04:31:28

问题


Hi I'm running a Xamarin PCL project thats deploying to all platforms including UWP windows 10 and windows 8.

I've just merged a branch on git and resolved some conflicts (not very well clearly) and i'm getting a few errors.

The first error:

The "GenerateResourceDesigner" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'Vigour, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Vigour.dll'
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(String fullName)
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.GetAssembly(String fileName)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.<Execute>c__AnonStorey0.<>m__0(String ass)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at Xamarin.Android.Tasks.ResourceDesignerImportGenerator.CreateImportMethods(IEnumerable`1 libraries)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() Vigour.Droid            

The second one:

I know this is a common problem and I've tried to un-tick and tick the build of each project in the solutions configuration.

I've also tried to remove the .vs/../.suo file to reset the project

However I've had no luck. I think that it might have something to do with the merger that involved changing the .csproj files.


回答1:


Try to set API to 23 and then Rebuild the project it will solve the problem




回答2:


Solution to this was to reinstall the xamarin forms for android and as @hvaughan3 said, deleting the bin and obj folder for all directories along with the packages.




回答3:


In my case, I was getting error The "ResolveLibraryProjectImports" task failed unexpectedly. when I open a project downloaded from Xamarin.University on Windows 10 and the path for one of the files ends up being to long (longer than 260 characters). So, to solve my problem, I would copy the directory as shallow as possible, so instead working directly in the structure of downloaded project, I would copy deepest directory containing the project into my C:. Building would work then without an issue as the path to all files in the project got shortened.

So, say my downloaded structure from Xamarin.University is something like C:\Users\me\Desktop\XAMARIN\XAMARIN CERTIFICATION\forms\xam300-advanced-cross-platform-development\Lab Materials\Part 03 Resources\Completed

I would copy the Completed folder into C and end up with much shorter path like: C:\Completed



来源:https://stackoverflow.com/questions/35631572/xamarin-generateresourcedesigner-task-failed-unexpectedly-and-dll-file-could

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!