Visual Studio throws exception after hdd went out of space - visual-studio

I had visual studio running while my HDD was unknowingly running out of available space, I have since cleared the issue and the HDD has multiple gigabytes of data free, but sadly something got broken during this unstable state, and I am receiving this error:
Recoverable
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.ProjectSystem.ProjectSerialization.CachedMsBuildGlobWithGaps.IsMatch(String stringToMatch)
at System.Linq.ImmutableCollectionsExtensions.Any[TElement,TArg(ImmutableArray\`1 immutableArray, Func\`3 predicate, TArg arg)
at System.Linq.ImmutableCollectionsExtensions.Any[TElement,TArg(ImmutableArray\`1 immutableArray, Func\`3 predicate, TArg arg)
at Microsoft.VisualStudio.ProjectSystem.ProjectSerialization.ConstructionUtilities.<>c__DisplayClass16_0.<CheckIfProjectConeChangedOnDisk>b__1(FileSystemEntry&entry)
at Microsoft.IO.Enumeration.FileSystemEnumerator\`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable\`1 source)
at Microsoft.VisualStudio.ProjectSystem.ProjectSerialization.ConstructionUtilities.CheckIfProjectConeChangedOnDisk(String projectPath, DateTime lastEvaluationTimeUtc, IEnumerable\`1 globs, IProjectTelemetryService telemetryService, UnconfiguredProject project)
at Microsoft.VisualStudio.ProjectSystem.ProjectSerialization.ProjectCacheService.IsProjectCacheUpToDateSlow(ConfiguredProject configuredProject)

Related

How do I change memory bytes in Visual Studio 2017?

I am trying to change bytes in memory, in a memory window, when debugging a C++ project in my Visual Studio 2017. The memory window is pointing at memory holding code, as I am trying to patch a piece of code quickly (just need to change parameter value) without needing to stop and re-compile.
I also noticed that you cannot change values in the memory window even for data memory.
Is there some hidden configuration setting to let you do that. It was possible to do this in VS6.
I found a kind of work-around, that works even for modifying executable code memory.
Here are the steps:
Define a spare global pointer in your code (you can actually use any memory pointer in your code as long as you do not care that you will change its value):
char* memptr;
Set the pointer in a watch window.
Set the pointer value to the memory address that you want to modify.
Expend the content (BTW you can use "memptr,100" in your watch window to access more than one byte).
Type the updated value in the expended byte value cells.
This works even if you set the pointer to executable machine code memory, so you can use it to patch code.
It can be an int pointer or any other type, or you can use a cast in the watch window if you desire to edit any other kinds of objects.
Be careful this can be dangerous, modifying of memory has to be done with the greatest of care.
How do I change memory bytes in Visual Studio 2017?
As far as I know, Microsoft does not support changing the memory bytes directly in the latest Visual Studio including VS2017 and there is no such hidden option to realize it.
In general, during debugging, the Memory window shows the memory space your app is using. And the Memory window isn't limited to displaying data. It displays everything in the memory space, including data, code, and random bits of garbage in unassigned memory.
Besides, memory bytes changes with the values of variables in debugger windows such as Watch, Autos, Local Variables, and QuickWatch dialogs. Then analyze its changes in memory usage to improve the program. Because of it, we cannot change it directly.
In addition, more info about Memory Window, you can check this official document.

Memory management error with Mono?

I have a program that was developed with C#/.NET 4.5.2 and runs fine on Windows (7 x64). The program handles a large amount of data, so it is compiled for x64 only. My largest input dataset can be processed on a PC with 16GB RAM.
When I try to run it on Ubuntu 16.04 LTS 64 bit; 64 GB RAM installed, everything is fine for smaller datasets but I started getting SIGSEGV signals with larger datasets. These errors do not always occur at the same position, and for intermediate sized datasets, they sometimes don't occur at all.
I upgraded my version of Mono so I am now running with 5.0.1.1:
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
Upgrading replaced the error with a NullReferenceException:
Native stacktrace:
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at (wrapper managed-to-native) System.Array:FastCopy (System.Array,int,System.Array,int,int)
at System.Array.Copy (System.Array sourceArray, System.Int32 sourceIndex, System.Array destinationArray, System.Int32 destinationIndex, System.Int32 length) [0x00068] in <a07d6bf484a54da2861691df910339b1>:0
at System.Collections.Generic.HashSet`1[T].SetCapacity (System.Int32 newSize, System.Boolean forceNewHashCodes) [0x0000f] in <26aedeede9534b948c539f8734c8492d>:0
at System.Collections.Generic.HashSet`1[T].IncreaseCapacity () [0x00025] in <26aedeede9534b948c539f8734c8492d>:0
at System.Collections.Generic.HashSet`1[T].AddIfNotPresent (T value) [0x000bc] in <26aedeede9534b948c539f8734c8492d>:0
at System.Collections.Generic.HashSet`1[T].Add (T item) [0x00000] in <26aedeede9534b948c539f8734c8492d>:0
at MyLib.MyClass.DoProcessing () [0x00a6e] in <66a585adc1684679bfec565c73eb94e4>:0
at MyLib.MyClass.SynchProcessing () [0x00000] in <66a585adc1684679bfec565c73eb94e4>:0
at MyApp.Program.Main (System.String[] args) [0x00139] in <e80b0468d8e642129fa7c39d5b2bb0a0>:0
In addition to HashSet< long >, it sometimes appears in Dictionary < long , Node > (where Node is a small class of two floats), but either way it is always when it is trying to add an element and in System.Array:FastCopy. This same location was reported by the older version of Mono when it gave a SIGSEGV. The errors occur in a single-threaded section of the code where the data is being read in & pre-processed (later it is multi-threaded, but that code has yet to produce the error, probably because all collections are already at their max size or shrinking)
So it looks like an internal pointer is being corrupted when a HashSet or Dictionary's underlying array is re-allocated.
Has anyone seen anything like this? I think it looks like a memory manager / Garbage Collector error, or even an underlying bug in Mono? However, searching Google and this site has not turned anything up. I see that Mono has a new GC but mono -V says it is running be default (and the SIGSEGV was being produced when the older version was being used).
Does anyone have any suggestions or solutions to try?
I don't know the heap & collection sizes when this error occurs. Next up I'll add some diagnostics to try and help although they'll make it slow and only give approximate values (eg. Console.WriteLine every 10,000 nodes, say)

Trying to open Windows Powershell. Access to memory restricted

I recently upgraded my pc to Windows 10 and for the most part everything seemed to be working fine. Powershell was working fine until I opened up a shell and got this error
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Management.Automation.LocationGlobber.GetProviderPath(String path, CmdletProviderContext context)
at System.Management.Automation.LocationGlobber.ResolveDriveQualifiedPath(String path, CmdletProviderContext context, Boolean allowNonexistingPaths, CmdletProvider& providerInstance)
at System.Management.Automation.LocationGlobber.GetGlobbedMonadPathsFromMonadPath(String path, Boolean allowNonexistingPaths, CmdletProviderContext context, CmdletProvider& providerInstance)
at System.Management.Automation.SessionStateInternal.SetLocation(String path, CmdletProviderContext context)
at System.Management.Automation.Runspaces.InitialSessionState.SetSessionStateDrive(ExecutionContext context, Boolean setLocation)
at System.Management.Automation.AutomationEngine..ctor(PSHost hostInterface, RunspaceConfiguration runspaceConfiguration, InitialSessionState iss)
at System.Management.Automation.Runspaces.LocalRunspace.DoOpenHelper()
at System.Management.Automation.Runspaces.RunspaceBase.CoreOpen(Boolean syncCall)
at Microsoft.PowerShell.ConsoleHost.OpenConsoleRunspace(Runspace runspace, Boolean staMode)
at Microsoft.PowerShell.ConsoleHost.DoCreateRunspace(String initialCommand, Boolean skipProfiles, Boolean staMode, Boolean importSystemModules, Collection`1 initialCommandArgs)
at Microsoft.PowerShell.ConsoleHost.CreateRunspace(Object runspaceCreationArgs)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
causing the prompt to show me a "Windows PowerShell has stopped working" popup. I tried running the shell as an admin and restarting my computer, waiting for the memory in RAM to decay. Is there an easy fix, such as reinstalling a framework, or would I need to buy a new RAM chip for my machine?
Machine specs:
Lenovo Yoga 13 (1st gen)
8GB RAM (originally came with 4, I upgraded)
104 GB Storage
Intel core i5-3337U # 1.80 GHz
64 bit
UPDATE
Going to the file location, I was able to open PowerShell(x86) with no problems. I can execute commands but I'd prefer to solve the regular PowerShell if possible.

Visual Studio Unicode Issue -- Internal Failure

I suddenly am getting what appears to be a Unicode issue in Visual Studio after a Windows 7 restart. Does anyone have an idea about how to resolve this? I've been messing around with virus scanners and .cspoj files (where the errors are located) for the last few hours to no avail.
Error 1 The build stopped unexpectedly because of an internal failure.
System.Text.EncoderFallbackException: Unable to translate Unicode character \uD97C at index 1321 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
at System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder)
at System.Text.UTF8Encoding.GetByteCount(String chars)
at System.IO.BinaryWriter.Write(String value)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketWriteTranslator.TranslateDictionary(Dictionary`2& dictionary, IEqualityComparer`1 comparer)
at Microsoft.Build.Execution.BuildParameters.Microsoft.Build.BackEnd.INodePacketTranslatable.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketWriteTranslator.Translate[T](T& value, NodePacketValueFactory`1 factory)
at Microsoft.Build.BackEnd.NodeConfiguration.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.NodeContext.SendData(INodePacket packet)
at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
at Microsoft.Build.Execution.BuildManager.IssueRequestToScheduler(BuildSubmission submission, Boolean allowMainThreadBuild, BuildRequestBlocker blocker)
AND THE ANSWER IS:
http://www.hanselman.com/blog/CSIVisualStudioUnableToTranslateUnicodeCharacterAtIndexXToSpecifiedCodePage.aspx
NB. Hans was the closest to working out what had happened... so I awarded the points to him
Well, the message is pretty accurate. \uD97C a utf-16 surrogate, surrogates must always appear in a pair to encode a character whose value is larger than \uFFFF. The exception message says that the second surrogate of the pair does not occur in the string.
Seeing this occur in a build is very bad news, such characters should never appear in project files. You don't write them in an ancient dead Middle-Eastern language or an obscure native American language with a couple of thousand people that still know how to speak it :). The only reasonable explanation is that the file(s) on your disk are scrambled all to hell. You'll need to get your machine fixed, replacing the disk should be high on your list of priorities right now.

Visual Studio 2010/2008 "Exception of type 'System.OutofMemoryEception' was thrown" error after clicking design form

My project include 350 forms, 780 thousand lines of code (350 thousand designer code).
But when i want to design form, every two or three design VS gives "Exception of type 'System.OutofMemoryEception' was thrown" error.
I am restart the project and this error gone until rebuild or open a few form... I couldn' work over 5 minutes...
I am looking at memory usage : devenv.exe using 500/600 mb and my sistem using 1.9 GB ram of 4GB ram
I don't think so but is VS crash or not support 350 forms in project?
Is there any solution about VS memory options?
This is screenshot :
http://social.microsoft.com/Forums/getfile/22517/
My system spesifics is;
Intel Core i5 CPU
4 GB RAM
Operation system :Windows XP 32 bit (at the windows 7 problem is same)
Visual Studio 2010 Ultimate (at Visual Studio 2008 Professional SP1 problem is the same)
Call Stacks
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_AssemblyName()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
You don't say whether you're running 32 or 64 bit XP. I would hazard a guess that you're running 32 and have just reached the limits of your PC. You'll only get around 2 Gigs virtual memory on most systems.
Either way I would seriously consider looking at restructuring your project as 350 WinForms seems pretty excessive to me. There must be some be some way in which you can reduce this to avoid duplication or to create class library projects that you can offload some of the functionality into.
You could give Solution Load Manager a try to mark projects and files as load on demand rather than on start up.

Resources