Comments (11)
my perspective. i always use embedded. the reason being is, when people raise issues against my projects with a stack trace, i want the line numbers without any extra dev config for them and without them needing to remember to deploy pdbs to production.
from inlineil.fody.
The issue is tested on both Linux and Windows.
Here is my projects:
- csproj file uses
InlineIL.Fody
and my own weaver.dotnet pack -c Release
producessnupkg
with invalid PDB file. - csproj uses only my own Fody weaver. This build works perfect.
- csproj has
InlineIL.Fody
weaver without my own weaver. PDB is not valid.
My weaver also modifies IL code and rewrites sequence points. However, it doesn't cause problem with PDB.
Conclusion: the problem is not caused by invalid order of other weavers in csproj
file or their intersection.
from inlineil.fody.
Interesting... InlineIL needs to modify some stuff in the debug info to get rid of the assembly reference when you use using static InlineIL.IL.Emit;
(it also adds sequence points in Debug mode by default), but it's Fody which decides which PDB file format to output, so I'm surprised enabling InlineIL makes a difference. I'd guess the error message is misleading here.
I'll try to reproduce this. Thanks for the report.
from inlineil.fody.
Thanks for the examples. I've tried to build and publish DotNext.Unsafe under a different (and hidden) package id using only dotnet pack -c Release
, and I'm getting a different error:
This error makes more sense than "not a portable PDB". I'll try to figure out why the checksum doesn't match.
In the meantime, could you tell me if the PDB in the snupkg file you tried to upload starts with BSJB
(as the first 4 bytes)? Because apparently that's the check the NuGet server is doing (see here).
from inlineil.fody.
So it looks like that Cecil currently doesn't handle PDB checksums. Here's the spec and here's the list of entries Cecil knows about, and as you can see there's no entry type 19 in there. 😞
The dll that Fody outputs doesn't even have a PDB checksum entry.
Here's the debug directory of the project when built with Fody disabled:
And here's what happens when Fody is enabled:
Even if I run Fody without any weaver, I get the same thing as above: there's no PdbChecksum
entry.
So... Are you sure you managed to upload a snupkg file that was produced by using Fody with your own weaver? I checked DotNext.Reflection
v0.12.0 and it doesn't have a PdbChecksum
entry either. NuGet.org should show the following links for a package with an associated symbol package:
But it doesn't show the "Download symbols" link for DotNext.Reflection
.
from inlineil.fody.
Yep, you right. Reflection
didn't have Symbols package. Probably it was dropped by Nuget without error. It's sad because a bug somewhere inside of Cecil. However, I checked today the checksum of embedded PDF and was fine. Look at this code in Fody repo. It uses different provider for embedded PDB which is probably working correctly. So my workaround is the only possible way to publish debug information. Anyway, many thanks for investigation!
from inlineil.fody.
Did you use dotPeek for analysis? I'll double check the correctness of embedded PDB tomorrow, don't have suitable tool for that on Linux.
from inlineil.fody.
You're welcome! 😉
I wouldn't really call this a bug in Cecil, as the checksum stuff is quite recent... It just was never implemented. I even didn't find any issue in the Cecil repo which mentions it, but I guess if the snupkg file format becomes popular this may become a problem and someone will implement it.
Embedded PDBs are very similar to portable PDBs, they're just deflated portable PDBs that are embedded in the assembly. EmbeddedPortablePdbWriter
is a wrapper around PortablePdbWriter
, see here).
TBH I don't like that snupkg stuff anyway, as embedded PDBs work just fine and without requiring the user to configure anything.
As for the analysis, I first used this code from the NuGet server, but when it showed that there's no PdbChecksum
entry at all, I opened the files in dotPeek just to make sure. dotPeek has a very nice metadata viewer which I found useful for this kind of stuff more than once.
from inlineil.fody.
I'm switched to embedded in the last release. But what if NuGet decides to verify checksum of the embedded PDF?
from inlineil.fody.
To be honest I don't know why Roslyn even bothers to emit the checksum for embedded PDBs... So yes I suppose NuGet could decide to validate this field, but I don't see a good reason to do that given it's in the same file.
Anyway, I reported an issue in the Cecil repo, and I may even give a shot at implementing this someday. I guess that if NuGet starts enforcing the checksum then this issue will get resolved really fast. 😉
from inlineil.fody.
I'm closing this as it's an upstream issue. See jbevain/cecil#610 for further info.
from inlineil.fody.
Related Issues (20)
- Using Calli() causes a build error in Debug configuration HOT 6
- Support .NET Standard 1.1 HOT 13
- Proposal: simplified arguments passing and first-class support of in parameters HOT 27
- nop after any Il HOT 2
- Loading of invalid method token HOT 4
- InlineIL.Fody and .NET Core 3.1 HOT 17
- [Feature] Would it be possible to declare fields? HOT 23
- [Proposal] Simplified ldftn/ldvirtftn HOT 14
- [Proposal] Referencing user-defined operators HOT 14
- Mixing C# and IL locals HOT 13
- Proposal: macroassembler-like support HOT 3
- IL.Push(expression) leads to invalid program HOT 2
- Error in .NET 7 Preview 7 HOT 7
- Creating labels in otherwise unreachable code fails HOT 3
- Usage Suggestion HOT 3
- Issue with calling T[] Span<T>.ToArray() HOT 7
- .NET 8 and static BLOB pattern using ROS<T> HOT 4
- Add a way to get a TypeRef from an assembly at provided path HOT 8
- FieldRef to generic class can not be resolved HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inlineil.fody.