Closed farzonl closed 7 months ago
We've had problems with VSTO for a very long time, and I've never known what was going wrong or how to fix it. Now we have answers, and that's great news.
But now we need to figure how to incorporate the fix without breaking anything else. I'll need to find some time soon to look at this a bit more closely.
We've had problems with VSTO for a very long time, and I've never known what was going wrong or how to fix it. Now we have answers, and that's great news.
But now we need to figure how to incorporate the fix without breaking anything else. I'll need to find some time soon to look at this a bit more closely.
No worries. I want to do this right. I was looking for ways to handle different versions of .net, and to my suprise I didn't find any usage of Environment.Version
and RuntimeInformation.FrameworkDescription
in this repo before mine. Thats pretty impressive given the shear number of platforms this projects suports between runtimes, oses, etc.
In anycase I put up the fix I mentioned to @tibel. Pleae let me know how you want to proceed.
@ericsink Is the use of RuntimeInformation.FrameworkDescription
in revision 4 sufficent to satify the concerns here?
Sorry, I haven't found time to look at this closely yet. But thanks for the nag. I'll try to get it done soon.
https://github.com/ericsink/SQLitePCL.raw/issues/552#issuecomment-1763379318
No worries Eric.
I wanted to show another way we could do this:
libgit2sharp is creating preprocessor blocks for .netframework. I tested it and it works in VSTO apps aswell.
@ericsink if it is possible to make a decision on this pr this month that would be ideal for me. I'm not sure what the next semester plan will be for the app I've built after November so can't promise to devote any time to this going forward.
Problem: In issue #552 I identified that VSTO is copying SQLitePCLRaw.core.DLL to
C:\Users\username\AppData\Local\assembly\dl3\<HASH_STRINGS>\ SQLitePCLRaw.core.DLL
but was not copyinge_sqlite3.dll
with it.SQLitePCLRaw.core.DLL
is expecting to finde_sqlite3.dll
in the same directory level as itself or a few levels down from it at<same_path>\runtimes\{os-arch}\native\e_sqlite3.dll
For VSTO apps nothing is copying the native dependency over. so e_sqlite3.dll isn't propogated.The Fix:
using
System.Reflection.Assembly.GetExecutingAssembly().CodeBase
we can get the original path of the copied over binary. This will be the same path wheree_sqlite.dll
lives. UsingPath.GetDirectoryName
We get the path without the base name and build out a path usingPath.Combine
and thelibname
.We define a new flag in
NativeLibrary
calledWHERE_CODEBASE
that will let us have a third option for lookup ofe_sqlite3
providers.I'm limiting to just
e_sqlite3
Because that is the library used by the App Center C# sdk.