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

Unity generated exception #33

Closed
zzragida opened this issue Jul 28, 2017 · 10 comments
Closed

Unity generated exception #33

zzragida opened this issue Jul 28, 2017 · 10 comments

Comments

@zzragida
Copy link

I tried unity project generate but not working.
error messages to below.

environment

  • Unity 2017.1.0f1(.net 3.5) or Unity 5.6.2f1
  • MagicOnionGenerate from github project

==============================================================
D:\library\Unity\MagicOnion\src\MagicOnion.CodeGenerator\bin\Debug\moc.exe --input=
GRPC-Client.csproj --output=Assets\Scripts\MagicOnion\MagicOnionGenerated.cs
Project Compilation Start:GRPC-Client.csproj
Project Compilation Complete:00:00:04.0922816

Method Collect Start

처리되지 않은 예외: System.Exception: Invalid Return Type, method:.cctor returnT
ype:void
위치: MagicOnion.CodeAnalysis.MethodCollector.ExtractRequestResponseType(IMet
hodSymbol method, MethodType& methodType, String& requestType, String& responseT
ype, ITypeSymbol& unwrappedOriginalResponseType) 파일 D:\library\Unity\MagicOnio
n\src\MagicOnion.CodeGenerator\CodeAnalysis\MethodCollector.cs:줄 187
위치: MagicOnion.CodeAnalysis.MethodCollector.CreateMethodDefinition(IMethodS
ymbol y) 파일 D:\library\Unity\MagicOnion\src\MagicOnion.CodeGenerator\CodeAnaly
sis\MethodCollector.cs:줄 123
위치: System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 위치: System.Linq.Buffer1..ctor(IEnumerable1 source) 위치: System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
위치: MagicOnion.CodeAnalysis.MethodCollector.b__8_0(INamedTypeSymbol
x) 파일 D:\library\Unity\MagicOnion\src\MagicOnion.CodeGenerator\CodeAnalysis\Me
thodCollector.cs:줄 73
위치: System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() 위치: System.Linq.Enumerable.<ConcatIterator>d__581.MoveNext()
위치: System.Linq.Buffer1..ctor(IEnumerable1 source)
위치: System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
위치: MagicOnion.CodeAnalysis.MethodCollector.Visit() 파일 D:\library\Unity\M
agicOnion\src\MagicOnion.CodeGenerator\CodeAnalysis\MethodCollector.cs:줄 72
위치: MagicOnion.CodeGenerator.Program.Main(String[] args) 파일 D:\library\Un
ity\MagicOnion\src\MagicOnion.CodeGenerator\Program.cs:줄 93

@neuecc
Copy link
Member

neuecc commented Jul 28, 2017

Thank you for try to use.
Hmn, could you show target class?

@zzragida
Copy link
Author

sure below that

IMyFirstService.cs

using MagicOnion;

namespace FooSample
{
public interface IMyFirstService : IService
{
UnaryResult SumAsync(int x, int y);
}
}

additionally my project folder
image

@neuecc
Copy link
Member

neuecc commented Jul 28, 2017

thanks, I've find if exists invalid class, can not generate.
I'll fix it but quick solution, separete service definition
https://github.com/neuecc/MagicOnion#project-structure and pass ServiceDefinition.csproj.

@zzragida
Copy link
Author

thanks. i will try service project seperate.

@zzragida
Copy link
Author

additionally i tried generate separate definition project and add method.
then same issue

D:\library\Unity\MagicOnion\src\MagicOnion.CodeGenerator\bin\Debug\moc.exe --input=ServiceDefin
tion\ServiceDefintion.csproj --output=GRPC-Client\Assets\Scripts\MagicOnionGenerated.cs
Project Compilation Start:ServiceDefintion\ServiceDefintion.csproj
Project Compilation Complete:00:00:06.3494738

Method Collect Start

처리되지 않은 예외: System.Exception: Invalid Return Type, method:SumLegacyTaskA
sync returnType:System.Threading.Tasks.Task<MagicOnion.UnaryResult>
위치: MagicOnion.CodeAnalysis.MethodCollector.ExtractRequestResponseType(IMet
hodSymbol method, MethodType& methodType, String& requestType, String& responseT
ype, ITypeSymbol& unwrappedOriginalResponseType) 파일 D:\library\Unity\MagicOnio
n\src\MagicOnion.CodeGenerator\CodeAnalysis\MethodCollector.cs:줄 187
위치: MagicOnion.CodeAnalysis.MethodCollector.CreateMethodDefinition(IMethodS
ymbol y) 파일 D:\library\Unity\MagicOnion\src\MagicOnion.CodeGenerator\CodeAnaly
sis\MethodCollector.cs:줄 123
위치: System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 위치: System.Linq.Buffer1..ctor(IEnumerable1 source) 위치: System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
위치: MagicOnion.CodeAnalysis.MethodCollector.b__8_0(INamedTypeSymbol
x) 파일 D:\library\Unity\MagicOnion\src\MagicOnion.CodeGenerator\CodeAnalysis\Me
thodCollector.cs:줄 73
위치: System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext() 위치: System.Linq.Enumerable.<ConcatIterator>d__581.MoveNext()
위치: System.Linq.Buffer1..ctor(IEnumerable1 source)
위치: System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
위치: MagicOnion.CodeAnalysis.MethodCollector.Visit() 파일 D:\library\Unity\M
agicOnion\src\MagicOnion.CodeGenerator\CodeAnalysis\MethodCollector.cs:줄 72
위치: MagicOnion.CodeGenerator.Program.Main(String[] args) 파일 D:\library\Un
ity\MagicOnion\src\MagicOnion.CodeGenerator\Program.cs:줄 93

IMyFirstService.cs

using MagicOnion;
using System.Threading.Tasks;

namespace FooSample
{
public interface IMyFirstService : IService
{
UnaryResult SumAsync(int x, int y);
Task<UnaryResult> SumLegacyTaskAsync(int x, int y);
Task<ClientStreamingResult<int, string>> ClientStreamingSampleAsync();
Task<ServerStreamingResult> ServerStreamingSampleAsync(int x, int y, int z);
Task<DuplexStreamingResult<int, string>> DuplexStreamingSampleAsync();
}
}

@zzragida
Copy link
Author

zzragida commented Aug 9, 2017

additionally more information to below
can not initialize ReferenceSymbols.cs INamedTypeSymbols

  • Task
  • TaskOfT
  • GenerateDefineIf

image

@neuecc
Copy link
Member

neuecc commented Aug 9, 2017

Is your project type new csproj?

@zzragida
Copy link
Author

zzragida commented Aug 9, 2017

Yes seperated new project.
Can i append project to solution?

@neuecc
Copy link
Member

neuecc commented Aug 9, 2017

Sorry, new means VS2017's new csproj structure.

@zzragida
Copy link
Author

zzragida commented Aug 9, 2017

Yes. that is VS2017's new csproj structure

@neuecc neuecc closed this as completed Jan 7, 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

No branches or pull requests

2 participants