I have a Xamarin.Forms App that used to work correctly, but after updating from Visual Studio 2017 to 2019 I am getting an exception in Xamarin.Android when trying to build the solution. I have not changed anything in my code. The exception I get is:
Error The "GenerateResourceDesigner" task failed unexpectedly.
System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
at Xamarin.Android.Tasks.ManagedResourceParser.Parse(String resourceDirectory, IEnumerable`1 additionalResourceDirectories, Boolean isApp, Dictionary`2 resourceMap)
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() EventApp
I have tried every possible thing like uninstalling and reinstalling Visual Studio 2019. Clearing bin and obj folders but nothing seems to work.
Does anyone know how can i fix this issue?
Have you updated all NuGet packages? Checked all dependencies? Updated to VS 16.3.5? Although not getting the same error, I am having problems with the latest VS and XF coupled with Google Ads. Another suggestion that didn't help me, but has helped others, is to add
android:targetSdkVersion="28"
to the uses-permission tags. Is the Net Core version set properly?
My Problem is resolved. it was some issue with Visual studio 2019. I clicked on Repair visual studio in VS installer , It took sometime and then my problem is solved. Anyway Thanks For help :)
Related
I'm trying to create a Visual Studio 2022 preview network installer to reuse the installation media between multiple computers.
I'm following the instructions from this page, but I'm downloading the preview installer from the VS preview page.
When I try to create the network installer from an elevated command prompt with
vs_community.exe --layout D:\VS\Community2022preview --useLatestInstaller
I'm getting the error message
Download of 'https://aka.ms/vs/17/pre/channel' succeeded using engine 'WebClient'
Download of 'https://download.visualstudio.microsoft.com/download/pr/b3f0a1e5-a37b-49a5-9c42-8724caed1f7b/b6c95d2cc95b704820db1e1355cfb2d1d075a8acf8e38b1ddaf1dafedb269521/VisualStudioPreview.vsman' succeeded using engine 'WebClient'
Catalog load operation correlation: {"id":"2d2ff4dd-dc49-49c9-94c7-35b8d0e072a6"}
Exception of type 'Microsoft.VisualStudio.Setup.UpdateRequiredException' was thrown.
Error: Exception of type 'Microsoft.VisualStudio.Setup.UpdateRequiredException' was thrown.
at Microsoft.VisualStudio.Setup.Engine.CheckForEngineUpdate(Version manifestEngineVersion)
at Microsoft.VisualStudio.Setup.Engine.Load(String path, Boolean skipVerify)
at Microsoft.VisualStudio.Setup.Layout.Commands.LayoutCommand.InvokeCommand(CancellationToken token)
at Microsoft.VisualStudio.Setup.Layout.Program.Main(String[] args)
I googled Microsoft.VisualStudio.Setup.UpdateRequiredException, but I didn't find anything.
Should this work for the VS 2022 community preview version?
Am I missing something?
Thanks!
I had the same error message with Visual Studio Professional 17.3.0. I followed Rodrigo Juarez's suggestion of removing --useLatestInstaller and that solved the problem so that seems to be the solution to this particular error.
Yesterday I studied a little MVC5 before bed.
Today, I open Visual Studio 2013 and while loading, the following exception occurs:
Exception Details
System.ArgumentNullException was unhandled
Message: An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
Additional information: Buffer cannot be null.
Parameter name: buffer
I have already repaired Visual Studio and nothing has changed.
Does anyone know what's going on?
The Update 5 worked for me. However you need to be part of Dev Essentials in order to download this update.
https://my.visualstudio.com/Downloads?q=Visual%20Studio%202013%20Update%205
Appears to be fixed now, although I see no confirmation on https://social.msdn.microsoft.com/Forums/en-US/46728392-212b-405e-aea0-2ab02f91cd1f/visual-studio-2013-crashes-on-startup?forum=visualstudiogeneral
I'm running VS2013 U3 and able to startup without issue. A colleague is able to run VS2013 as well.
After having a problem with my installation of Visual Studio 2017 Microsoft recommended me to run InstallCleanup.exe -full this command removed Visual Studio 2017 and the Visual Studio installer from my computer but in the process broke something.
Now when I try to install Visual Studio 2017 the Visual Studio 2017 installer throws a TypeInitializationException whenever I select a version of Visual Studio to install.
The log file shows the following stack trace:
2017-05-25T17:19:18 : Verbose : Getting product. [installerId: SetupEngine, productId: Microsoft.VisualStudio.Product.Community].
2017-05-25T17:19:21 : Error : Failed to get product. [installerId: SetupEngine, productId: Microsoft.VisualStudio.Product.Community, error: TypeInitializationException at The type initializer for 'Microsoft.VisualStudio.Setup.Utility.StringUtility' threw an exception.
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceSpecialFolders(String value)
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceVariables(String value, IEnumerable`1 parameters)
at Microsoft.VisualStudio.Setup.ProductInstaller.GetSerializableProduct()
at Microsoft.VisualStudio.Setup.ProductsProviderService.GetProduct(String channelId, String productId)]
Unfortunately I've been unable to correct this. I've redownload the installer. uninstalled and removed anything related to VS2017, rebooted, cleaned the temp folder. Nothing seems to have any affect.
I've asked Microsoft for guidance here, but two similar bug reports here and here stay unanswered, so I've got little hope.
I would look at the source code for the StringUtility class that seems to cause the problem. But I do not believe that is open source. (I could not find a similar class on referencesource). I would also try to debug the running application by attaching a debugger, but alas I have no Visual Studio and can't install a new one :).
Does anybody have any clue how I could try to figure out what causes this Exception? Or what dependencies I could check?
Edit: after using Collect.exe to gather more information I've found the InnerException:
05/25/2017 17:55:17 : Error : System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.Setup.Utility.StringUtility' threw an exception. ---> System.ArgumentException: Absolute path information is required.
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks)
at Microsoft.VisualStudio.Setup.Utility.StringUtility..cctor()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceSpecialFolders(String value)
at Microsoft.VisualStudio.Setup.Utility.StringUtility.ReplaceVariables(String value, IEnumerable`1 parameters)
at Microsoft.VisualStudio.Setup.ProductInstaller.GetSerializableProduct()
at Microsoft.VisualStudio.Setup.ProductsProviderService.GetProduct(String channelId, String productId)Failed to get a catalog
Looks like there is some sheneningans with an invalid path? But how will I ever find out what path :)?
After another day of searching I figured it out.
Notice how the stack trace includes this line
at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks)
So the invalid folder is one of Windows Special Folders. Of which there are only a few. With a Powershell script I tested all Special folders. I then noticed that the following powershell command threw a very similar exception.
[environment]::GetFolderPath("MyVideos")
Digging further I found the following registry key:
Note the missing \ it should be D:\Videos\ not D:Videos I manually edited this a while ago. The path seems to be valid in some Windows functions. But not in the .Net function.
I deleted the Library and then restored the defaults. (Right click, the library in the library pane to delete it. Then right click on the library icon and choose restore defaults.)
After rebooting (without it it wouldn't work) The PS script showed that the Special Folder path worked. And voila! the Visual Studio Installer also worked again :D.
I was wondering if you have experienced this vague issue when trying to copy a text in visual studio.net 2010 SP1:
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
I've got Git Extensions and NuGet add-ons installed. I've also tried opening vs.net running in administrator mode.
Was wondering if anybody has encountered this issue and what steps have been done to amend it?
Cheers,
A
I did have this happen right after installing the MVC4 beta, I was literally using copy/paste is that what you mean? In this case I had to reinstall.
Howdy, I noticed that Visual Studio crashed when I tried to open a .SQL file. Perhaps this was due to me installing SQL SERVER 2008 last week. Anyway to overcome the issue I repaired Visual Studio using the install disc. One hour later and a couple of reboots the issue remained. However now the thing crashes as soon as I select a project!
Here's what the event viewer says:
EventType clr20r3, P1 devenv.exe, P2
10.0.40219.1, P3 4d5f2a73, P4 microsoft.visualstudio.editor.implementation,
P5 10.0.0.0, P6 4d5f2b24, P7 d2, P8
9a, P9 system.nullreferenceexception,
P10 NIL.
I'm starting to lose the will to live.
With Regards to Andrei Drynov's answer / comment **
Okay, the service pack is on there, the contents of the SQL file are irrelevant as the files opened with ease previously and it happens on that file type not a specific file also the crashing happens regardless of the project/solution I select? I do agree that I am being dramatic!
After starting in safe mode **
I got the following error
"An exception was encountered while
constructing the content of this
frame. This information is also
logged by running the application with
the /log parameter on the command
line, which stores results in
"C:\Documents and
Settings\XXXXXXX\Application
Data\Microsoft\VisualStudio\10.0\ActivityLog.xml".
Exception details:
System.UnauthorizedAccessException:
Package
'Attrice.TeamFoundation.Sidekicks.VisualStudio.MainPackage,
Attrice.TeamFoundation.Sidekicks.Package.10,
Version=3.0.3.1, Culture=neutral,
PublicKeyToken=14bece0700b6dc89'
failed to load. at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo) at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32
errorCode) at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
I then got the following
Microsoft Visual Studio
'C:\Dev\XXXXXX.Deploy.wdproj'
cannot be opened because its project
type (.wdproj) is not supported by
this version of the application.
To open it, please use a version that
supports this type of project.
So I'll reinstall the Visual Studio® 2010 Web Deployment Projects to see if that works? How odd.
This worked a treat!
Thank God!
Visual Studio 2010 hangs up when opening a .sql file
You are being quite dramatic )))
Please provide more information, e.g. post the SQL file contents, tell more about the project type, etc.
BTW, did you install service pack 1?
I had a VS2010 solution with two Database projects that, on and off, crashed VS2010 on opening.
After a few attempts I noticed that the .SLN file had the two projects correctly referenced BUT the TAG SccNumberOfProjects referenced 3 instead of 2.
Global\GlobalSection\SccNumberOfProjects = 3
I "text-edited" for 2 and it worked, at least for now.
As the crash was happening on and off with no apparent reason, I cannot guarantee that this was in fact THE solution; use at your own risk and of course, backup files first. ;)