diff --git a/src/Strategy/NuGet/PackageReference.hs b/src/Strategy/NuGet/PackageReference.hs
index 40383a963..3f7d74973 100644
--- a/src/Strategy/NuGet/PackageReference.hs
+++ b/src/Strategy/NuGet/PackageReference.hs
@@ -12,7 +12,7 @@ module Strategy.NuGet.PackageReference
, Package(..)
) where
-import Control.Applicative (optional)
+import Control.Applicative (optional, (<|>))
import Control.Effect.Diagnostics
import Data.Foldable (find)
import qualified Data.List as L
@@ -90,7 +90,7 @@ instance FromXML ItemGroup where
instance FromXML Package where
parseElement el =
Package <$> attr "Include" el
- <*> optional (attr "Version" el)
+ <*> optional (attr "Version" el <|> child "Version" el)
buildGraph :: PackageReference -> Graphing Dependency
buildGraph project = Graphing.fromList (map toDependency direct)
diff --git a/test/NuGet/testdata/test.csproj b/test/NuGet/testdata/test.csproj
index 75740b0a5..ab347fb83 100644
--- a/test/NuGet/testdata/test.csproj
+++ b/test/NuGet/testdata/test.csproj
@@ -19,7 +19,9 @@
-
+
+ 3.0.0
+
runtime; build; native; contentfiles; analyzers
all