Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change mpc to sdk-based project,update MSBuildLocator for Linux(and mac?) #296

Closed

Conversation

itn3000
Copy link
Contributor

@itn3000 itn3000 commented Aug 2, 2018

Problem

I executed mpc.exe in docker container(mono:5.12), then I failed with following error.

Project Compilation Start:../../sandbox/TestData2/TestData2.csproj

Unhandled Exception:
System.TypeLoadException: Parent class failed to load, due to: Could not load type of field 'Microsoft.CodeAnalysis.MSBuild.ProjectFile:_loadedProject' (1) due to: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:(null) signature:<none> assembly:/MessagePack-CSharp/src/MessagePack.CodeGenerator/bin/Debug/Microsoft.CodeAnalysis.Workspaces.Desktop.dll type:ProjectFile member:(null) signature:<none>
  at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,bool)
  at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.Boolean icase, System.RuntimeType reflectedType) [0x0001b] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00006] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x0001e] in <a4b6e470f95047fb822f681582b0e302>:0 
  at Microsoft.CodeAnalysis.Host.Mef.DesktopMefHostServices.get_DefaultServices () [0x00011] in <1644e7370de141eca00406e57c629f50>:0 
  at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create (System.Collections.Generic.IDictionary`2[TKey,TValue] properties) [0x00000] in <1644e7370de141eca00406e57c629f50>:0 
  at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create () [0x00000] in <1644e7370de141eca00406e57c629f50>:0 
  at MessagePack.CodeGenerator.RoslynExtensions+<GetCompilationFromProject>d__0.MoveNext () [0x002b4] in <ff14fa52702e42b4b95003f526cca7aa>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at MessagePack.CodeGenerator.TypeCollector..ctor (System.String csProjPath, System.Collections.Generic.IEnumerable`1[T] conditinalSymbols, System.Boolean disallowInternal, System.Boolean isForceUseMap) [0x006c1] in <ff14fa52702e42b4b95003f526cca7aa>:0 
  at MessagePack.CodeGenerator.Program.Main (System.String[] args) [0x00070] in <ff14fa52702e42b4b95003f526cca7aa>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Parent class failed to load, due to: Could not load type of field 'Microsoft.CodeAnalysis.MSBuild.ProjectFile:_loadedProject' (1) due to: Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:(null) signature:<none> assembly:/MessagePack-CSharp/src/MessagePack.CodeGenerator/bin/Debug/Microsoft.CodeAnalysis.Workspaces.Desktop.dll type:ProjectFile member:(null) signature:<none>
  at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,bool)
  at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.Boolean icase, System.RuntimeType reflectedType) [0x0001b] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00006] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x0001e] in <a4b6e470f95047fb822f681582b0e302>:0 
  at Microsoft.CodeAnalysis.Host.Mef.DesktopMefHostServices.get_DefaultServices () [0x00011] in <1644e7370de141eca00406e57c629f50>:0 
  at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create (System.Collections.Generic.IDictionary`2[TKey,TValue] properties) [0x00000] in <1644e7370de141eca00406e57c629f50>:0 
  at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create () [0x00000] in <1644e7370de141eca00406e57c629f50>:0 
  at MessagePack.CodeGenerator.RoslynExtensions+<GetCompilationFromProject>d__0.MoveNext () [0x002b4] in <ff14fa52702e42b4b95003f526cca7aa>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0 
  at MessagePack.CodeGenerator.TypeCollector..ctor (System.String csProjPath, System.Collections.Generic.IEnumerable`1[T] conditinalSymbols, System.Boolean disallowInternal, System.Boolean isForceUseMap) [0x006c1] in <ff14fa52702e42b4b95003f526cca7aa>:0 
  at MessagePack.CodeGenerator.Program.Main (System.String[] args) [0x00070] in <ff14fa52702e42b4b95003f526cca7aa>:0 

Fixes

update some packages and some related fixes, then success.
change to sdk-based project for dotnet build.
note: output path of mpc.exe is changed(bin/${ConifgurationName}/mpc.exe -> bin/Debug/net461/mpc.exe)

@itn3000
Copy link
Contributor Author

itn3000 commented Aug 2, 2018

sorry, this fix still have some problem, I close the PR.

@itn3000 itn3000 closed this Aug 2, 2018
@itn3000
Copy link
Contributor Author

itn3000 commented Aug 2, 2018

I added problem description.

@itn3000 itn3000 reopened this Aug 2, 2018
@neuecc
Copy link
Member

neuecc commented Aug 2, 2018

Thanks, it seems good.
I'll merge at an early date.

@itn3000
Copy link
Contributor Author

itn3000 commented Aug 26, 2018

fixed conflicts and remove redundant deps(Microsoft.CodeAnalysis.Analyzers)

@dzmitry-lahoda
Copy link
Contributor

Was it merged? I hope to allow people from Mac to run mpc. I think fix may help.

@AArnott
Copy link
Collaborator

AArnott commented Oct 22, 2019

Please revisit after #591 merges if this still adds value.

@AArnott AArnott closed this Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants