IT:AD:NET:PCL:HowTo:Convert a FF dll to PCL dll
Summary
Projects:XActLib started off as a Full Framework library years back.
Things have changed, and the library needs to be moved to WinRT, Ag, etc.
That's why I have to go back through the library updating its *.csproj files to make as many dll's as possible compile as PCL classes.
Method
In Visual Studio:
* Search/Replace ComVisible attribute:
- Find:
[assembly: ComVisible( - Replace:
// [assembly: ComVisible(
* Search/Replace assembly: Guid( attribute:
- Find:
[assembly: Guid(" - Replace:
// [assembly: Guid("
Build Targets
In the *.csproj,
in order to import new Build functionality, change the default target import to the PCL target:
//<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
ProjectTypeGuids
In the *.csproj, in order to make the dll a PCL:
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
TargetFrameworkVersion and TargetFrameworkProfile
In the *.csproj, in order to define what Profile the PCL should target:
<TargetFrameworkProfile>Profile158</TargetFrameworkProfile>
goes hand in hand with:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>