Closed Aurora12 closed 9 years ago
Hmm, that's a scenario I have not thought about, I suppose it's really a general problem with using nugets? What happens if you manually reference the 328 (PCL) version in both projects?
I'm getting the same error, could you remove the JetBrains reference, please?
This seems to have been built against JetBrains.Annotations
8.0.5, but the package includes 9.1.1. Something's gone a little wrong - I'd suggest rebuilding the dll in the SQLite package. The 9.1.1 annotation dlls contain a bunch of attributes that are all marked with [Conditional("JETBRAINS_ANNOTATIONS")]
(I suspect this wasn't in 8.0.5). Unless you define JETBRAINS_ANNOTATIONS
when building the SQLite dll, the annotations don't get compiled in - so under normal use, the SQLite dll will have no binary reference to JetBrains.Annotations
at all, and you won't need the reference to JetBrains.Annotations
9.1.1 in the package, either (you could mark it as a developer dependency in the SQLite's packages.confis
).
The downside to doing this is that consumers of the assembly don't get the benefits of attributes - they're only useful when editing the source of the SQLite library. If you'd like consumers of your library to get use out of the annotations, you should remove the reference to the JetBrains.Annotations
package, and instead include the source for the annotations directly in your project. You can get the source from ReSharper → Options → Code Annotations. ReSharper 9.1 allows you to get the source where all the annotations are marked as internal
. This is highly recommended, as it prevents the annotation attributes being visible to the consumers of your dll (but the attributes are still visible to, and used by, ReSharper).
Hope this helps.
@citizenmatt Ok, I will try that, thanks for the help:)
@oysteinkrog Seems to work fine after I manually replace JetBrains.Annotations.PCL1.dll reference with JetBrains.Annotations.PCL328.dll. I'm not sure why the wrong library gets referenced during installation, but this is a stable behaviour.
Hmm ok, well IMO this seems like a general nuget problem to me. I will do as suggested and bundle the annotations inside the project instead. I had hoped to avoid this but it seems I have little choice. By doing so there will be no external dependecies. I'll try to get to it this evening or during the weekend.
Thanks for your work, much appreciated! @oysteinkrog
I'm using the latest
SQLite.Net.Async PCL 3.0.4-beta
in my Universal Store Project. Works fine when built for WP8.1, but gets me an error (below) when built for Windows 8.1. The error is thrown on the firstCreateTableAsync()
call.The package installs
JetBrains.Annotations 9.1.1
dependency which gets you a reference toJetBrains.Annotations.PCL1.dll
in desktop part of the project. (While when installing for Windows Phone part, it gets you a reference toJetBrains.Annotations.PCL328.dll
.)When I launch desktop version:
So, it looks like the reference is wrong or something... Is ReSharper annotations dependency even needed there?