#Problem
I have created a portable class library with the same target frameworks as the FluentValidation.Portable project but installing the NuGet package FluentValidation 4.0.0.0 fails with the following message :
> Adding 'FluentValidation 4.0.0.0' to PortableClassLibrary1.
Could not install package 'FluentValidation 4.0.0.0'. You are trying to install this package into a project that targets 'portable-win+net40+sl40+wp80', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I am using the latest version of NuGet (2.6) with a portable library that supports .NET for Windows Store apps, .NET Framework 4 and higher, Silverlight 4 and higher and Windows Phone 8.
#Solution
I have found that the subfolder created in the "lib" directory of the package is named "portable-wp8+sl5+win8" whereas NuGet expects "portable-win+net40+sl40+wp80".
The fix I found is simply to change the "DestinationFolder" attribute of the "Copy" task in the "CreatePackages" target of the "\buildscripts\Deployment.proj" file (line 49 in the commit df5e3df1a5f90792d3516455d3114ecfb74cd61e).
This line :
```
<Copy SourceFiles="@(PortableBinaries)" DestinationFolder="$(PackageDir)\temp\FluentValidation$(PackageSuffix)\lib\portable-wp8%2Bsl5%2Bwin8\%(RecursiveDir)"/>
```
should be :
```
<Copy SourceFiles="@(PortableBinaries)" DestinationFolder="$(PackageDir)\temp\FluentValidation$(PackageSuffix)\lib\portable-win%2Bnet40%2Bsl40%2Bwp80\%(RecursiveDir)"/>
```
I have not created a fork / pull request for this fix as it seems to be an overkill for such a small modification.
#Workaround
If you do not want to wait for the next official release of the packages, here is a workaround :
- Download the NuGet package
- Rename the "portable-wp8+sl5+win8" folder to "portable-win+net40+sl40+wp80" inside the NuGet package.
- Install the package with the "Install-Package" PowerShell cmdlet :
```
Install-Package -Source "D:\MyDownloadedPackages" -Id FluentValidation
```
Thanks.
Comments: Ah, that was my mistake - the PCL should target >= 5. I'll get that changed for the next build. Jeremy
I have created a portable class library with the same target frameworks as the FluentValidation.Portable project but installing the NuGet package FluentValidation 4.0.0.0 fails with the following message :
> Adding 'FluentValidation 4.0.0.0' to PortableClassLibrary1.
Could not install package 'FluentValidation 4.0.0.0'. You are trying to install this package into a project that targets 'portable-win+net40+sl40+wp80', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
I am using the latest version of NuGet (2.6) with a portable library that supports .NET for Windows Store apps, .NET Framework 4 and higher, Silverlight 4 and higher and Windows Phone 8.
#Solution
I have found that the subfolder created in the "lib" directory of the package is named "portable-wp8+sl5+win8" whereas NuGet expects "portable-win+net40+sl40+wp80".
The fix I found is simply to change the "DestinationFolder" attribute of the "Copy" task in the "CreatePackages" target of the "\buildscripts\Deployment.proj" file (line 49 in the commit df5e3df1a5f90792d3516455d3114ecfb74cd61e).
This line :
```
<Copy SourceFiles="@(PortableBinaries)" DestinationFolder="$(PackageDir)\temp\FluentValidation$(PackageSuffix)\lib\portable-wp8%2Bsl5%2Bwin8\%(RecursiveDir)"/>
```
should be :
```
<Copy SourceFiles="@(PortableBinaries)" DestinationFolder="$(PackageDir)\temp\FluentValidation$(PackageSuffix)\lib\portable-win%2Bnet40%2Bsl40%2Bwp80\%(RecursiveDir)"/>
```
I have not created a fork / pull request for this fix as it seems to be an overkill for such a small modification.
#Workaround
If you do not want to wait for the next official release of the packages, here is a workaround :
- Download the NuGet package
- Rename the "portable-wp8+sl5+win8" folder to "portable-win+net40+sl40+wp80" inside the NuGet package.
- Install the package with the "Install-Package" PowerShell cmdlet :
```
Install-Package -Source "D:\MyDownloadedPackages" -Id FluentValidation
```
Thanks.
Comments: Ah, that was my mistake - the PCL should target >= 5. I'll get that changed for the next build. Jeremy