In this post we will be discussing one more common question people ask regarding Portable Class Library projects. This is about how to find out the list of assemblies referenced by the project. The question is raised because the references section is displayed as follows:
Object Browser
The first option is to use the Object Browser [View -> Object Browser]. Just select "My Solution". You might need to unload the other projects if you need to just see the assembly references caused by the portable class library project in the solution.
Class View
We can also see the referenced assemblies in the class explorer. This is also available in View Menu [View -> Class View].
Profile Folder
One of the option is to directly go to the folder for the specific profile and see the assemblies in the folder. The profile information can be found in the solution explorer as follows:
And here are the available assemblies for the profile.
Showing posts with label assembly reference. Show all posts
Showing posts with label assembly reference. Show all posts
Sunday, November 11, 2012
Assembly References For a Profile In a Portable Class Library Project
Tuesday, October 23, 2012
Issues / Bugs with Assembly References in Portable Class Library Projects
As we know that a portable class library can only reference other portable library projects. For this example, we are using Portable Library Tools 2 Extension installed through Extension Manager in Visual Studio 2010.
There seem to be two rules for assembly / project references in a portable class library project.
No Checks for Portable assembly references:
The only verification for assembly references seem to be that the source assembly must be a portable library. It doesn't seem to verify the platform selection of the source assembly.
Let's look at the sample solution with two portable class library projects as follows:
The platforms selection of the PortableSourceLibrary and PortableTargetLibrary is as follows:
From the platform selection it is apparent that PortableSourceLibrary is targeting a bigger subset of features than the PortableTargetLibrary project. Based on the rules discussed above, a reference of PortableClassLibrary project can be added to the PortableSourceLibrary project.
For the same reason vice versa is not true i.e. when we try to add a reference of PortableSourceLibrary into PortableTargetLibrary, the IDE doesn't allow so and shows the error notification dialog. But when we try to add the assembly reference instead of the project reference, it doesn't show the same behavior.
And it silently adds the reference.
This is definitely a different behavior than the project reference and it needs to be requested to be fixed.
No Verification when the target platforms for source portable library project is updated:
Portable Class Library project checks whether the source portable library project has the compatible platforms selection as the current project. But it seem that this is only checked when the reference is being added. Once the reference is added then we can change it to an incompatible platforms selection and this would still build fine.
Let's again add PortableTargetLibrary project reference into PortableSourceLibrary project.
Now select the PortableTargetLibrary project and update the target frameworks as follows:
Now this is the combination which would be an issue if we add a fresh reference of this project to PortableSourceLibrary project. But there doesn't seem to be any issue now when the reference is already added.
Please note that the project having the references does report issues when we unload the project and try to load it again. We can't load it unless we update the target platforms for the source project being referenced.
I have reported the issue on Microsoft Connect. Please vote for this.
https://connect.microsoft.com/VisualStudio/feedback/details/768350/assembly-references-in-portable-library-projects
Download
There seem to be two rules for assembly / project references in a portable class library project.
- Portable Class Library Project can only reference other portable class library projects / assemblies.
- The project where the reference is being added must have compatible set of framework selection as the project / assembly whose reference is being added. This compatibility is difficult to understand. Basically the available features set of the source assembly / project must be same or smaller than the target project. This happens when the source project / assembly is either targeting the same set of frameworks or has more framework selections than the target portable class library project.
No Checks for Portable assembly references:
The only verification for assembly references seem to be that the source assembly must be a portable library. It doesn't seem to verify the platform selection of the source assembly.
Let's look at the sample solution with two portable class library projects as follows:
The platforms selection of the PortableSourceLibrary and PortableTargetLibrary is as follows:
From the platform selection it is apparent that PortableSourceLibrary is targeting a bigger subset of features than the PortableTargetLibrary project. Based on the rules discussed above, a reference of PortableClassLibrary project can be added to the PortableSourceLibrary project.
For the same reason vice versa is not true i.e. when we try to add a reference of PortableSourceLibrary into PortableTargetLibrary, the IDE doesn't allow so and shows the error notification dialog. But when we try to add the assembly reference instead of the project reference, it doesn't show the same behavior.
And it silently adds the reference.
This is definitely a different behavior than the project reference and it needs to be requested to be fixed.
No Verification when the target platforms for source portable library project is updated:
Portable Class Library project checks whether the source portable library project has the compatible platforms selection as the current project. But it seem that this is only checked when the reference is being added. Once the reference is added then we can change it to an incompatible platforms selection and this would still build fine.
Let's again add PortableTargetLibrary project reference into PortableSourceLibrary project.
Now select the PortableTargetLibrary project and update the target frameworks as follows:
Now this is the combination which would be an issue if we add a fresh reference of this project to PortableSourceLibrary project. But there doesn't seem to be any issue now when the reference is already added.
Please note that the project having the references does report issues when we unload the project and try to load it again. We can't load it unless we update the target platforms for the source project being referenced.
I have reported the issue on Microsoft Connect. Please vote for this.
https://connect.microsoft.com/VisualStudio/feedback/details/768350/assembly-references-in-portable-library-projects
Download
Subscribe to:
Posts (Atom)













