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
mpc.exe: exception occured while trying to generate #386
Comments
I think you need to point MPC to .csproj, not Assembly-CSharp.csproj. At least that was the case for me on the old version of MPC before it became "MessagePackUniversalCodeGenerator". |
Hi Simon, thanks for the suggestion but unfortunately it doesn't seem to matter whether I point it to Assembly-CSharp.csproj or the project named .csproj (eg. MyProject.csproj), I still get the same the same error. |
related to #355 ? |
we use the latest master branch and have an exception too john-kampitakis:MessagePack-CSharp john$ dotnet build src/MessagePack -f netstandard1.6 Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core Restore completed in 35.03 ms for /Users/john/Documents/MessagePack-CSharp/src/MessagePack/MessagePack.csproj. Build succeeded. Time Elapsed 00:00:00.96 john-kampitakis:MessagePack-CSharp john$ dotnet run -p src/MessagePack.UniversalCodeGenerator -- -i /Users/john/Documents/llshooter/Assembly-CSharp.csproj -o Generated.cs Using launch settings from src/MessagePack.UniversalCodeGenerator/Properties/launchSettings.json... |
Ah, I've encounted same problem, @itn3000 Could you know any info? |
I think @superduperbob case and @jkampitakis case are different. but I think It may be triggered by analyzing project using il2cpp. I will investigate it deeper. |
I made the branch for second case. first case is because both Unity's msbuild is deployed to difficult place for auto detecting, |
replacing Buildalyzer to MSBuild.StructuredLogger for Unity project(#386)
We have some "progress" in this. Using the latest mpc build. john-kampitakis:osx-x64 john$ ./mpc -- -i /Users/john/Documents/llshooter/Assembly-CSharp.csproj -o Generated.cs |
It might be caused by mixed file path with |
Inside my Assembly-CSharp.csproj I see that there is the following line "Compile Include=Assets\Appodeal\Api\Appodeal.cs />" This path seems alright to me. Does mpc reads it from somewhere else maybe? Thanks. |
Is there any new progress on this issue? I step into the same error message and I also tried to fix it, but without any success. Is there way to create the generated file by hand? |
Using the latest master branch we still have errors: dotnet run -p src/MessagePack.UniversalCodeGenerator -- -i /Users/john/Documents/llshooter/Assembly-CSharp.csproj -o Generated.cs Produces the following error: File name: '/Users/john/Documents/llshooter/Temp/bin/Debug/Assembly-CSharp-firstpass.dll' |
Hello, dotnet run -p src/MessagePack.UniversalCodeGenerator -i /Users/john/Documents/llshooter/Assembly-CSharp.csproj -o Generated.cs and the result is: Using launch settings from src/MessagePack.UniversalCodeGenerator/Properties/launchSettings.json... If we use the branch "mpc-normalize-path-separator": dotnet run -p src/MessagePack.UniversalCodeGenerator -i /Users/john/Documents/llshooter/Assembly-CSharp.csproj -o Generated.cs Project Compilation Start:/Users/john/Documents/llshooter/Assembly-CSharp.csproj |
I'm running into the same error. I'm trying to workaround this by putting all messagepackobjects from my project to a clean project and it generates all the files properly. |
One thing I've noticed is that you need to have the MessagePack files under the same assembly as the classes you want to generate code from. I tried having MessagePack in the Plugins folder or under its own assembly, but only got an empty file. |
There is definitely an issue with assemblies. My project uses assemblies so I want to generate from a different .csproj than Assembly-CSharp.proj, and I'd also like to include MessagePack in a different assembly than the target. However, when message pack is executed on the command line it always looks in Assembly-CSharp.proj for path information. This information is never correct because the folder where I want to keep message pack is always in a different assembly. My workaround:
Here is the error that occurs when the path in Assembly-CSharp.proj is not correct.
|
Oops, was wrong about one thing. It seems the MessagePack files DO need to be a part of the same assembly as the target csproj file. |
I also get the above error if I try to change or remove the namespace of a MessagePackObject class when the MessagePack.Generated.cs file already exists. Deleting MessagePack.Generated.cs allows the file to be re-generated without errors. Edit at least, I thought that was what was happening. But now it seems the command simply fails/succeeds randomly. Even after an error on the console, re-running the same exact command was successful? Now I'm really confused... Edit 2 and now everything works fine from the command line, but always fails when I run it from a Process in the editor. WTAF? lol (again without any changes to my code or the command) |
I occurred the problem like @LloydVincent wrote. This behaviour seems begun to occur after I added an asmdef file to the project. |
Also got this error - today tried upgrading from 1.7.3.7 to latest
|
This issue mainly talked about preview generator for 1.x, that is outdated. |
Hi there,
I'm currently working on a Unity project that is not PC exclusive and the other platforms require IL2CPP to build. After looking at the documentation it seems like I should use mpc to generate the code needed. Unfortunately I cannot seem to get mpc to generate anything as it keeps failing after running the command:
"C:\Users\me\Desktop\MessagePackUniversalCodeGenerator\win-x64\mpc.exe" -i "Assembly-CSharp.csproj" -o "MessagePackGenerated.cs"
When running this, I get the follow error:
C:\dev\test\Project\test2>"C:\Users\me\Desktop\MessagePackUniversalCodeGenerator\win-x64\mpc.exe" -i "Assembly-CSharp.csproj" -o "MessagePackGenerated.cs" Project Compilation Start:Assembly-CSharp.csproj exception occured(fname=dotnet, args=msbuild "C:\dev\test\Project\test2\Assembly-CSharp.csproj" /t:ResolveAssemblyReferencesDesignTime;ResolveProjectReferencesDesignTime;ResolveComReferencesDesignTime;Compile /p:IntermediateOutputPath="C:\dev\test\Project\test2\__buildtemp" /p:ProviderCommandLineArgs="true" /p:GenerateResourceMSBuildArchitecture="CurrentArchitecture" /p:DesignTimeBuild="true" /p:BuildProjectReferences="false" /p:SkipCompilerExecution="true" /p:DisableRarCache="true" /p:AutoGenerateBindingRedirects="false" /p:CopyBuildOutputToOutputDirectory="false" /p:CopyOutputSymbolsToOutputDirectory="false" /p:SkipCopyBuildProduct="true" /p:AddModules="false" /p:UseCommonOutputDirectory="true" /p:GeneratePackageOnBuild="false" /p:RunPostBuildEvent="false" /p:SolutionDir="C:\dev\test\Project\test2\Assembly-CSharp.csproj" /bl:"C:\dev\test\Project\test2\__buildtemp\build.binlog" /v:n):System.ComponentModel.Win32Exception (2): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at MessagePack.CodeGenerator.ProcessUtil.ExecuteProcessAsync(String fileName, String args, Stream stdout, Stream stderr, TextReader stdin, CancellationToken ct) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\ProcessUtil.cs:line 29 at MessagePack.CodeGenerator.RoslynExtensions.TryExecute(String csprojPath, String tempPath, Boolean useDotNet) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\RoslynExtensions.cs:line 67 execute
dotnet msbuildfailed, retry with
msbuildexception occured(fname=msbuild, args="C:\dev\test\Project\test2\Assembly-CSharp.csproj" /t:ResolveAssemblyReferencesDesignTime;ResolveProjectReferencesDesignTime;ResolveComReferencesDesignTime;Compile /p:IntermediateOutputPath="C:\dev\test\Project\test2\__buildtemp" /p:ProviderCommandLineArgs="true" /p:GenerateResourceMSBuildArchitecture="CurrentArchitecture" /p:DesignTimeBuild="true" /p:BuildProjectReferences="false" /p:SkipCompilerExecution="true" /p:DisableRarCache="true" /p:AutoGenerateBindingRedirects="false" /p:CopyBuildOutputToOutputDirectory="false" /p:CopyOutputSymbolsToOutputDirectory="false" /p:SkipCopyBuildProduct="true" /p:AddModules="false" /p:UseCommonOutputDirectory="true" /p:GeneratePackageOnBuild="false" /p:RunPostBuildEvent="false" /p:SolutionDir="C:\dev\test\Project\test2\Assembly-CSharp.csproj" /bl:"C:\dev\test\Project\test2\__buildtemp\build.binlog" /v:n):System.ComponentModel.Win32Exception (2): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at MessagePack.CodeGenerator.ProcessUtil.ExecuteProcessAsync(String fileName, String args, Stream stdout, Stream stderr, TextReader stdin, CancellationToken ct) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\ProcessUtil.cs:line 29 at MessagePack.CodeGenerator.RoslynExtensions.TryExecute(String csprojPath, String tempPath, Boolean useDotNet) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\RoslynExtensions.cs:line 67 Unhandled Error:System.Exception: failed to build project at MessagePack.CodeGenerator.RoslynExtensions.GetAnalyzerResults(AnalyzerManager analyzerManager, String csprojPath, String[] preprocessorSymbols) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\RoslynExtensions.cs:line 101 at MessagePack.CodeGenerator.RoslynExtensions.GetWorkspaceWithPreventBuildEventAsync(AnalyzerManager manager) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\RoslynExtensions.cs:line 148 at MessagePack.CodeGenerator.RoslynExtensions.GetCompilationFromProject(String csprojPath, String[] preprocessorSymbols) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Utils\RoslynExtensions.cs:line 126 at MessagePack.CodeGenerator.TypeCollector..ctor(String csProjPath, IEnumerable1 conditinalSymbols, Boolean disallowInternal, Boolean isForceUseMap) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\CodeAnalysis\TypeCollector.cs:line 212 at MessagePack.CodeGenerator.Program.Main(String[] args) in C:\GitHubRepositories\MessagePack-CSharp\src\MessagePack.UniversalCodeGenerator\Program.cs:line 90
Anyone else had this before? I've tried different variations of this command and I just cannot get it to run.
Thanks for looking,
Matt
The text was updated successfully, but these errors were encountered: