Build/Test Issues

The tag 'XYZ' does not exist in XML namespace

Started by qujck on 9,942 views

This is my first Wpf project so this could be something simple I'm doing wrong.

I've added the AvalonEdit control to my form (based on the Sample), as shown here


<Window x:Class="Qujck.MarkdownEditor.MainWindow"
        xmlns="(- BROKEN LINK -)"
        xmlns:x="(- BROKEN LINK -)"
        xmlns:d="(- BROKEN LINK -)"
        xmlns:mc="(- BROKEN LINK -)"
        xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
        xmlns:local="clr-namespace:Qujck.MarkdownEditor"
        mc:Ignorable="d"
        Title="Qujck Markdown Editor" Height="350" Width="530" WindowStartupLocation="CenterScreen" WindowState="Maximized">
    <Grid Name="MainGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <avalonEdit:TextEditor
			Name="TextEditor"
			FontFamily="Segoe UI"
			FontSize="12pt"
			SyntaxHighlighting="MarkDown"
            ScrollViewer.CanContentScroll="True" 
            ScrollViewer.HorizontalScrollBarVisibility="Auto" 
            ScrollViewer.VerticalScrollBarVisibility="Auto"
            ScrollViewer.ScrollChanged="ScrollChanged"
            WordWrap="True"
            Grid.Column="0">
        </avalonEdit:TextEditor>
        <WebBrowser Name="RenderedView" Grid.Column="1">
        </WebBrowser>
    </Grid>
</Window>


I get a build error due to the entry
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"


The error I get from NCrunch is:
The tag 'TextEditor' does not exist in XML namespace 'http://icsharpcode.net/sharpdevelop/avalonedit'. Line 15 Position 10.
. The code builds and runs fine in VS.

Any idea how I fix this?

Edited

Hi, thanks for sharing this issue.

Can you confirm that you're only receiving the build error for the NCrunch build and not a normal VS build?

If so, my first thought would be that the declaration behind this namespace is somehow not being located inside the NCrunch workspace. Check your compiler warnings to see if there is any useful information here. It may be worth taking a look at the NCrunch workspace itself (right-click the failed build, go to Advanced->Browse to workspace) and running a command-line MSBuild against the generated project file in here. You should be able to troubleshoot the snapshot inside the workspace, adding/removing files as necessary to see if you can find how NCrunch has failed to construct the workspace. Most likely there'll be a file you'll need to add to the 'Additional files to include' setting, or you may need to turn on the 'Copy referenced assemblies to workspace' setting for the project.
Hi @Remco, the code also builds for TeamCity pulling from GitHub and in AppVeyor
Ok, it's working but I have no real idea why - I changed Embed Interop Types to true, VS build failed, changed it back to false and VS and NCrunch builds both succeed.

Doing so made a slight modification to the project file

From this:

<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.1.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
  <HintPath>..\packages\AvalonEdit.5.0.2\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
  <Private>True</Private>
</Reference>


To this:

<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.1.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
  <HintPath>..\packages\AvalonEdit.5.0.2\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
  <Private>True</Private>
  <EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>


And now NCrunch can build it just fine ....

Edited

I'm glad you managed to get it to work. I can honestly say that how this change would have made the difference it did is beyond me, but the build system is so complex and pluggable that nothing is ever truly certain! Thanks for taking the time to post the solution.

Post a reply

Log in to reply.