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

MissingMethodException for mysql_insert_id #202

Closed
gordon-matt opened this issue Apr 11, 2018 · 13 comments
Closed

MissingMethodException for mysql_insert_id #202

gordon-matt opened this issue Apr 11, 2018 · 13 comments

Comments

@gordon-matt
Copy link
Contributor

I just updated my packages from version 0.9.0-CI00872 to version 0.9.0-CI00880 and I am getting a MissingMethodException, as follows:

System.MissingMethodException: Method not found: 'Int32 Peachpie.Library.MySql.MySql.mysql_insert_id(Pchp.Core.Context, Pchp.Core.PhpResource)'. at <Script>.BuiltinFunctions(Action`2 callback)

Stack Trace:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Int32 Peachpie.Library.MySql.MySql.mysql_insert_id(Pchp.Core.Context, Pchp.Core.PhpResource)'.
   at <Script>.BuiltinFunctions(Action`2 callback)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at Pchp.Core.Context.AddScriptReference(Type tscript)
   at Peachpie.Web.PhpHandlerMiddleware.LoadScriptAssemblies(PhpRequestOptions options)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
   at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass4_0.<UseMiddleware>b__0(RequestDelegate next)
   at Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

I can only assume this is due to the last commit.

@jakubmisek
Copy link
Member

restore & rebuild

@gordon-matt
Copy link
Contributor Author

@jakubmisek I already have and it didn't work. Just did a rebuild now again to make sure.. no difference.

@jakubmisek
Copy link
Member

you definitely not consolidated your package references

@gordon-matt
Copy link
Contributor Author

@jakubmisek Oh but I most definitely did... I've just checked my .csproj as well. See before and after (I'm using TortoiseGit's file compare tool):

BEFORE:

<PackageReference Include="Peachpie.Library" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.Graphics" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.MsSql" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.MySql" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.Network" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.PDO" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.Scripting" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.Library.XmlDom" Version="0.9.0-CI00872" />
<PackageReference Include="Peachpie.NETCore.Web" Version="0.9.0-CI00872" />

AFTER:

<PackageReference Include="Peachpie.Library" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.Graphics" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.MsSql" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.MySql" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.Network" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.PDO" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.Scripting" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.Library.XmlDom" Version="0.9.0-CI00880" />
<PackageReference Include="Peachpie.NETCore.Web" Version="0.9.0-CI00880" />

And I know this is not necessary, but JUST to make sure... I also deleted the bin and obj folders, then reopened Visual Studio and did a rebuild again... no difference.

@jakubmisek
Copy link
Member

Have you checked all the projects - msbuildproj, csproj, ...

@gordon-matt
Copy link
Contributor Author

Hold on.. sorry.. I see the problem. Look here: https://ibb.co/nvix2H

@gordon-matt
Copy link
Contributor Author

SDK is the only lib not referenced directly by main project. I will fix. Thanks for your time anyway

@jakubmisek
Copy link
Member

good, once we stop making changes to API, this would not be necessary

@gordon-matt
Copy link
Contributor Author

@jakubmisek I have a problem. If i install the Peachpie.NET.Sdk package directly on the main project, it makes some changes (like removing the Dependencies folder from the solution). I assume this is because it now thinks it's going to be a PHP only library. So I'm in a crappy situation here, because if I don't use Peachpie.NET.Sdk in the main app, then it won't work, because there will be a conflict with my peachpie file manager library nuget package referencing the old SDK and if I try to reference the new SDK from my project, then it messes up my project. Is there anything you can do on your end to prevent the SDK library making such changes automatically? Otherwise, the only option left is to constantly keep releasing new versions of my file manager every time I want to update the Peachpie libraries.

@jakubmisek
Copy link
Member

Yes you have to re-release it for every peachpie version. Usually you would make releases for every major version (like once in 6 months) but if you wish to update daily you have to update daily everything.

@gordon-matt
Copy link
Contributor Author

Ouch, that's a pain. OK I guess we can't do anything about it. Thanks anyway. When are you guys planning to release the stable version?

@jakubmisek
Copy link
Member

there are few major features to do before 1.0 version, see https://github.com/peachpiecompiler/peachpie/wiki/Peachpie-Roadmap for more information. But I think we are getting closer : )

@EamonNerbonne
Copy link

@gordon-matt you should be able to add a reference without running install scripts, right? If you add a direct dependency on SDK simply by editing the csproj, then there shouldn't be an issue with any install scripts running and altering your project.

Also, since semver allows breaking changes below 1.0 at every version, peachpie might be able to avoid this by using non-suffixed versions, so the normal resolution mechanics have a chance to resolve conflicting dependencies.

But at the end of the day - if you have dependencies with conflicting and incompatible versions, then it's never going to actually work - right? In other words - ResponsiveFileManager needs to update its dependency version for this to work; and until then you're going to need to stick to that version if you going to avoid conflicts. All of the above tweaks to your project file and peachpie won't help if it's a real conflict.

If it's not a real conflict, then there's an argument to be made that even if the software isn't mature, it's time to start versioning with normal semantics (i.e. 1.0 and up) in any case. You're not going to be able to combine minor-version semantics while labeling everything as incompatible prereleases.

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

3 participants