The extern alias ‘xxx’ was not specified in a /reference option

I have the same problem and I was able to reproduce the issue.

It turns out reference aliases are ignored on projects containing xaml files which has an xmlns definition to the output assembly like xmlns:local=”clr-namespace:TestProject”.

If you think this is your case as well, please vote up my bug report at Microsoft Connect.

EDIT:
There is a suggested workaround in the link above which requires editing the project file manually. In order for this to work, I had to give full path of the assembly. Add the following instructions to the end of your project file:

<Target Name="solveAliasProblem" >
<ItemGroup>
 <ReferencePath Remove="FullPath.dll"/>
 <ReferencePath Include="FullPath.dll">
    <Aliases>ourAlias</Aliases>
 </ReferencePath>
</ItemGroup>
</Target>
<PropertyGroup>
    <CoreCompileDependsOn>solveAliasProblem;$(PrepareResourcesDependsOn)</CoreCompileDependsOn>
</PropertyGroup>

Leave a Comment

tech