runtime: [ARM32/Windows] Invalid access to memory location

  1. I’m using a Windows Arm32 environment. I’ve tried both Windows IOTCore and Windows Nano Server ARM containers (mcr.microsoft.com/windows/iotcore:1809_arm && mcr.microsoft.com/windows/nanoserver:1809_arm)
  2. Install dotnet SDK (2.2.100)
  3. mkdir app
  4. cd pp
  5. dotnet new console
  6. dotnet restore

Results:

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
System.IO.IOException: Invalid access to memory location : 'C:\app'
   at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry()
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.IO.Directory.GetFiles(String path, String searchPattern)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessProjectSwitch(String[] parameters, String[] projectsExtensionsToIgnore,
DirectoryGetFiles getFiles)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, Co
mmandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`
2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, List`1& distributedLoggerRecords, Int32& cpuCount, Bool
ean& enableNodeReuse, TextWriter& preprocessWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsAsMe
ssages, Boolean& enableRestore, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, Bo
olean recursing)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)

Unhandled Exception: System.IO.IOException: Invalid access to memory location : 'C:\app'
   at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry()
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.IO.Directory.GetFiles(String path, String searchPattern)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessProjectSwitch(String[] parameters, String[] projectsExtensionsToIgnore,
DirectoryGetFiles getFiles)
   at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, Co
mmandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`
2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, List`1& distributedLoggerRecords, Int32& cpuCount, Bool
ean& enableNodeReuse, TextWriter& preprocessWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsAsMe
ssages, Boolean& enableRestore, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, Bo
olean recursing)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)

If you run dotnet run you get the same exception just a little different code path.

System.IO.IOException: Invalid access to memory location : 'C:\app'
   at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry()
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.IO.Directory.GetFiles(String path, String searchPattern)
   at Microsoft.DotNet.Tools.Run.RunCommand.FindSingleProjectInDirectory(String directory)
   at Microsoft.DotNet.Tools.Run.RunCommand.Initialize()
   at Microsoft.DotNet.Tools.Run.RunCommand.Start()
   at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
'''

**dotnet --info**

.NET Core SDK (reflecting any global.json): Version: 2.2.100 Commit: 51868761f2

Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-arm Base Path: C:\Program Files\dotnet\sdk\2.2.100\

Host (useful for support): Version: 2.2.0 Commit: 1249f08fed

.NET Core SDKs installed: 2.2.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 26 (25 by maintainers)

Most upvoted comments

Just hit this trying to run a self-hosted ASP.NET Core site as part of a BackgroundTask on IoT Core. That is, it’s actually

UWP => .NET Standard 2.0 library with app startup info => ASP.NET Core 2.0

The build and deploy seems to work, but I get the error noted here when ASP.NET Data Protection tries to save info to the filesystem.

I’m hoping maybe someone can point me to some docs or other resources that might explain…

  • When this fix comes out in .NET Core 2.2.1, how do I take the update? Do I just install the new SDK and set a global.json to ensure I’m using that, or is there more to it?
  • Is there anything I’ll need to do on the UWP or Windows IoT Core side?

I’ve tried searching but getting the right terms to get decent results is hard. “Core” could be .NET Core, IoT Core, ASP.NET Core… 🤔

This is only a problem if you are writing unsafe code that casts byte pointer to the pointer to the struct.

If you leave it up to the runtime to allocate the struct (on stack or on heap), it is going to have the right alignment. As far as I can tell, all the cases you have listed are allocated by the runtime and do not have this problem.

This bug is blocking us supporting Windows ARM32 for .NET Core 2.2. Can you ensure that a fix gets into .NET Core 2.2.1?