Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

The tag 'XYZ' does not exist in XML namespace
qujck
#1 Posted : Saturday, September 12, 2015 11:04:21 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/19/2014(UTC)
Posts: 17
Location: United Kingdom

Thanks: 9 times
Was thanked: 2 time(s) in 2 post(s)
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

Code:

<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
Code:
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"


The error I get from NCrunch is:
Quote:
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?
Remco
#2 Posted : Saturday, September 12, 2015 11:10:24 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,979

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
1 user thanked Remco for this useful post.
qujck on 9/12/2015(UTC)
qujck
#3 Posted : Saturday, September 12, 2015 11:16:07 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/19/2014(UTC)
Posts: 17
Location: United Kingdom

Thanks: 9 times
Was thanked: 2 time(s) in 2 post(s)
Hi @Remco, the code also builds for TeamCity pulling from GitHub and in AppVeyor
qujck
#4 Posted : Saturday, September 12, 2015 12:03:51 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/19/2014(UTC)
Posts: 17
Location: United Kingdom

Thanks: 9 times
Was thanked: 2 time(s) in 2 post(s)
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:
Code:

<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:
Code:

<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 ....
Remco
#5 Posted : Saturday, September 12, 2015 9:58:41 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,979

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download