eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
http://expand.expandframework.com
Microsoft Public License
220 stars 114 forks source link

VersionConverter throws NullReference when project doesn't have DX references #493

Closed gerritmulder closed 5 years ago

gerritmulder commented 5 years ago

Description We have a Utils project which only references eXpandLib and doesn't reference any DevExpress references, because we only use Xpand.Utils for this project. This fails since 19.1.501, because the ModelMapper is added to eXpandLib, which added the VersionConverter too. The VersionConverter doesn't recognize the DevExpress version for projects that do not have DevExpress references and throws the exception Exception calling "Match" with "3" argument(s): "Value can not be null"

Solution The solution would be to change the script or release the Utils project as a NuGet package.

Work-around Add the <DevExpressVersion> element to the PropertyGroup in your .csproj

Additional information Problem where this occurs, the $include variable is null because the $packageReference and the $dxReferences variables are both null. https://github.com/eXpandFramework/DevExpress.XAF/blob/319d672212f8f8f8c2524bc4046ef1a72bf08f40/tools/Xpand.VersionConverter/Functions.ps1#L220-L221

.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Xpand.VersionConverter" Version="1.0.34" />
  </ItemGroup>

</Project>
expand commented 5 years ago

eXpand.lab release 19.1.502.4 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

expand commented 5 years ago

eXpand.lab release 19.1.502.7 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

expand commented 5 years ago

eXpand.lab release 19.1.502.8 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.