Base solution for your next web application
Open Closed

Attempted to read or write protected memory #3205


User avatar
0
yachea created

I just downloaded latest version of project : ASP.NET CORE & Angular v4.0.0 and I tried to run it. (EF & Database update worked fine) But I am getting this error message when trying to run the Api host ?

" System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' "

Swagger api web page never show up ?

Can you please advise how to make the project work ?

Thanks


9 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Have you searched this on the internet ? This problem seems to be related Visual Studio or Windows.

    Thanks.

  • User Avatar
    0
    yachea created

    Nothing conclusive on the internet so far.

    More details:

    I also get this error otherwise ( If I don't get the memory message I'll see the flowing one )

    " The following error occurred when trying to configure IIS Express for project myProjectName.Web.Host.Filename: \?\D:\MyProjectFolder\aspnet-core.vs\config\applicationhost.config Error: Cannot read configuration file "

    Also I've downloaded and run ASP.NET Boilerplate Framework with no issue from the first shot on the same Visual Studio 2017 and same Windows 7 machine.

    Also I re-downloaded you package several times and restarted new project form scratch each time, with multiple machine restarts.

    Yet I had no luck to run your project, even though ASP.NET Boilerplate works out of the box form the first time.

    Please advise,

    Thank you very much

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    • Can you try to run VS as administrator and see if it works ?
    • Also have you tried it on another machine ? Does the same problem occur ?
  • User Avatar
    0
    yachea created

    Hello,

    Trying with admin account didn't work. Trying on different machine worked but still need to make it work on my main development machine.

    I tried updating the .Net Framework on my machine to .NET Framework 4.6.2 and then to .NET Framework 4.7 And also added some attributes to catch the exception details.

    At first I got this message :

    Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x70c5f13b, on thread 0x2338. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

    Now I am getting this message (copied from Visual Studio debugger)

    e.Message

    One or more errors occurred.

    e.StackTrace

    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.Start(Int32 count) at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[TContext](IHttpApplication`1 application) at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start() at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host, CancellationToken token, String shutdownMessage) at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(IWebHost host) at cmpcore.Web.Startup.Program.Main(String[] args)

    e.InnerException.Message

    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    e.InnerException.StackTrace

    at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.NativeMethods.uv_loop_init(UvLoopHandle handle) at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.loop_init(UvLoopHandle handle) at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvLoopHandle.Init(Libuv uv) at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelThread.ThreadStart(Object parameter)

    e.InnerException.Source "Microsoft.AspNetCore.Server.Kestrel"

    e.InnerException.Source.TargetSite

    {Int32 uv_loop_init(Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvLoopHandle)}

    Please advise,

    I still not able to use your product since more the a month of trying every day .., it's becoming a bit urgent for me to getting work,

    Thank you for your assistance

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for the detailed information. Your problem is probably related to KestrelHttpServer.

    Can you try to update it's version to 2.0.0-preview1 and see if it works ?

  • User Avatar
    0
    yachea created

    " Can you try to update it's version to 2.0.0-preview1 and see if it works ? "

    Could you please tel me the specific steps to that ? (Should I install something on my machine ?, Nuget something ? , manually substitute a dll into my solution ? )

    (I found github source code here on " <a class="postlink" href="https://github.com/aspnet/KestrelHttpServer/releases">https://github.com/aspnet/KestrelHttpServer/releases</a>" but it's not compiling out of the box)

    Do I need to install/update anything related to .NET Core /.NET Core 2.0.0 Preview 1 as well ?

    If so please let me know the specifics steps to do that as well

    Thank you for your help

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It is a nuget package, you need to update it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Host/MyCompanyName.AbpZeroTemplate.Web.Host.csproj#L41">https://github.com/aspnetzero/aspnet-ze ... csproj#L41</a>.

    Thanks.

  • User Avatar
    0
    yachea created

    Now I am getting this error when I try to install the package

    (Note: I have selected from on download page * Framework (required) --> .NET Framework 4.6.1 | NOT --> .NET Core 1.1)

    (I also tried by upgrading from .NET Framework 4.6.1 to .NETFramework,Version=v4.7 )

    I am getting the flowing error message with both .NET Framework 4.6.1 and 4.7

    PM> Install-Package Microsoft.AspNetCore.Server.Kestrel -Pre

    Restoring packages for P:\AspNetZero\cmpcore\aspnet-core\src\cmpcore.Web.Host\cmpcore.Web.Host.csproj... GET <a class="postlink" href="https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json">https://api.nuget.org/v3-flatcontainer/ ... index.json</a> OK <a class="postlink" href="https://api.nuget.org/v3-flatcontainer/newtonsoft.json/index.json">https://api.nuget.org/v3-flatcontainer/ ... index.json</a> 136ms GET <a class="postlink" href="https://api.nuget.org/v3-flatcontainer/newtonsoft.json/5.0.1/newtonsoft.json.5.0.1.nupkg">https://api.nuget.org/v3-flatcontainer/ ... .0.1.nupkg</a> OK <a class="postlink" href="https://api.nuget.org/v3-flatcontainer/newtonsoft.json/5.0.1/newtonsoft.json.5.0.1.nupkg">https://api.nuget.org/v3-flatcontainer/ ... .0.1.nupkg</a> 29ms

    [**** Here Starts the red highlight until the end *****]

    Install-Package : Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview1-final is not compatible with net47 (.NETFramework,Version=v4.7). Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview1-final supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0) At line:1 char:1

    • Install-Package Microsoft.AspNetCore.Server.Kestrel -Pre
    •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
      
      

    Install-Package : One or more packages are incompatible with .NETFramework,Version=v4.7. At line:1 char:1

    • Install-Package Microsoft.AspNetCore.Server.Kestrel -Pre
    •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
      
      

    Install-Package : Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview1-final is not compatible with net47 (.NETFramework,Version=v4.7) / win7-x86. Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview1-final supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0) At line:1 char:1

    • Install-Package Microsoft.AspNetCore.Server.Kestrel -Pre
    •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
      
      

    Install-Package : One or more packages are incompatible with .NETFramework,Version=v4.7 (win7-x86). At line:1 char:1

    • Install-Package Microsoft.AspNetCore.Server.Kestrel -Pre
    •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
      
      

    Install-Package : Package restore failed. Rolling back package changes for 'cmpcore.Web.Host'. At line:1 char:1

    • Install-Package Microsoft.AspNetCore.Server.Kestrel -Pre
    •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
        + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
      
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Our version is noot using .NETFramework,Version=v4.7, did you change it yourself ? By the way, I'm suggesting you some solutions but it seems like this problem is related to your development environment. You can find better answers if you search the problem on the web I think.

    Thanks.