{"action":"created","issue":{"url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/134","repository_url":"https://api.github.com/repos/ArxOne/MrAdvice","labels_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/134/comments","events_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/134/events","html_url":"https://github.com/ArxOne/MrAdvice/issues/134","id":347030770,"node_id":"MDU6SXNzdWUzNDcwMzA3NzA=","number":134,"title":"Task.Run async ... await fails on .NetCore (.NetFramework works)","user":{"login":"hhblaze","id":486781,"node_id":"MDQ6VXNlcjQ4Njc4MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/486781?v=4","gravatar_id":"","url":"https://api.github.com/users/hhblaze","html_url":"https://github.com/hhblaze","followers_url":"https://api.github.com/users/hhblaze/followers","following_url":"https://api.github.com/users/hhblaze/following{/other_user}","gists_url":"https://api.github.com/users/hhblaze/gists{/gist_id}","starred_url":"https://api.github.com/users/hhblaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhblaze/subscriptions","organizations_url":"https://api.github.com/users/hhblaze/orgs","repos_url":"https://api.github.com/users/hhblaze/repos","events_url":"https://api.github.com/users/hhblaze/events{/privacy}","received_events_url":"https://api.github.com/users/hhblaze/received_events","type":"User","site_admin":false},"labels":[{"id":172315109,"node_id":"MDU6TGFiZWwxNzIzMTUxMDk=","url":"https://api.github.com/repos/ArxOne/MrAdvice/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-02T14:13:40Z","updated_at":"2018-08-03T07:49:22Z","closed_at":null,"author_association":"NONE","body":"May be can be helpful for someone.\r\n\r\nWas difficult to find in a big project why the weaving stops without any extra information... This line caused the problem:\r\n\r\n```C#\r\n Task.Run(async () => { await OpenSocketHandler(client); });\r\n```\r\n\r\n```TXT\r\n1>MrAdvice 2.5.24 weaved module 'JCore, Version=1.437.2018.727, Culture=neutral, PublicKeyToken=null' (targeting framework ) in 1632ms\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error : Unhandled exception: dnlib.DotNet.Writer.ModuleWriterException: **Couldn't find an instruction, maybe it was removed. It's still being referenced by some code or by the PDB**\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.DummyLogger.Log(Object sender, LoggerEvent loggerEvent, String format, Object[] args)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.ModuleWriterBase.dnlib.DotNet.ILogger.Log(Object sender, LoggerEvent loggerEvent, String format, Object[] args)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.dnlib.DotNet.Writer.IWriterError.Error(String message)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.SerializerMethodContext.GetOffset(Instruction instr)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Pdb.Portable.PortablePdbCustomDebugInfoWriter.WriteAsyncMethodSteppingInformation(PdbAsyncMethodCustomDebugInfo cdi)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Pdb.Portable.PortablePdbCustomDebugInfoWriter.Write(PdbCustomDebugInfo cdi)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.AddCustomDebugInformationCore(SerializerMethodContext serializerMethodContext, UInt32 encodedToken, PdbCustomDebugInfo cdi, Guid cdiGuid)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.AddCustomDebugInformation(SerializerMethodContext serializerMethodContext, UInt32 token, UInt32 encodedToken, PdbCustomDebugInfo cdi)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.AddCustomDebugInformationCore(SerializerMethodContext serializerMethodContext, Table table, UInt32 rid, IList`1 cdis)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.AddCustomDebugInformationList(MethodDef method, UInt32 rid, UInt32 localVarSigToken)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.WriteMethodBodies()\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.Create()\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.MetaData.CreateTables()\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.ModuleWriter.WriteImpl()\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.ModuleWriterBase.Write(Stream dest)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.Writer.ModuleWriterBase.Write(String fileName)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at dnlib.DotNet.ModuleDef.Write(String filename, ModuleWriterOptions options)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at StitcherBoy.Reflection.ModuleManager.Write(String assemblyOriginatorKeyFile)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at StitcherBoy.Weaving.Build.AssemblyStitcher.Process(StringDictionary parameters, Guid buildID, DateTime buildTime, String entryAssemblyPath)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at StitcherBoy.Weaving.StitcherProcessor.Process(StringDictionary parameters, Guid buildID, DateTime buildTime, String entryAsemblyPath)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at StitcherBoy.Weaving.StitcherProcessor.Process(StringDictionary parameters, Guid buildID, DateTime buildTime, String entryAsemblyPath)\r\n1>C:\\Users\\blaze\\.nuget\\packages\\mradvice\\2.5.24\\build\\MrAdvice.targets(10,5): error :    at StitcherTask`1.Run(Boolean fromExe)\r\n```"},"comment":{"url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/comments/410174445","html_url":"https://github.com/ArxOne/MrAdvice/issues/134#issuecomment-410174445","issue_url":"https://api.github.com/repos/ArxOne/MrAdvice/issues/134","id":410174445,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDE3NDQ0NQ==","user":{"login":"hhblaze","id":486781,"node_id":"MDQ6VXNlcjQ4Njc4MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/486781?v=4","gravatar_id":"","url":"https://api.github.com/users/hhblaze","html_url":"https://github.com/hhblaze","followers_url":"https://api.github.com/users/hhblaze/followers","following_url":"https://api.github.com/users/hhblaze/following{/other_user}","gists_url":"https://api.github.com/users/hhblaze/gists{/gist_id}","starred_url":"https://api.github.com/users/hhblaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhblaze/subscriptions","organizations_url":"https://api.github.com/users/hhblaze/orgs","repos_url":"https://api.github.com/users/hhblaze/repos","events_url":"https://api.github.com/users/hhblaze/events{/privacy}","received_events_url":"https://api.github.com/users/hhblaze/received_events","type":"User","site_admin":false},"created_at":"2018-08-03T07:49:22Z","updated_at":"2018-08-03T07:49:22Z","author_association":"NONE","body":"Let's start from \r\n```C#\r\n Task.Run(async () => { await OpenSocketHandler(client); });\r\n```\r\nproblem, here is a [project TestMrAdvice02.zip](https://github.com/ArxOne/MrAdvice/files/2256485/TestMrAdvice02.zip)\r\n\r\nThe second mistake for me is hard to reproduce, it appears in a complex big project in case if I change correct  pattern \r\n```C#\r\n Task.Run(async () => { await OpenSocketHandler(client); });\r\n```\r\non incorrect\r\n```C#\r\n Task.Run(() => { OpenSocketHandler(client); });\r\n```\r\n(though it is probably wrong). \r\nMay be after fixing the pattern such mistake will disappear - let's see. \r\n(And all the time we talk about .NetCore, in .NetFramework all works)"}}
{"actor":{"display_login":"hhblaze"}}