2

I have a WPF application and my XAML says "Invalid Markup" but the program still compiles with no issues. I want this fixed because it makes it very difficult to design UI without any actual UI to look at while I'm writing XAML. Is there a fix for this? I'm using VS Pro 2019

The Error

XDG0008 The name "IntToImageConverter" does not exist in the namespace "clr-namespace:SDB". Line 14

I have done some research and have tried:

  • Cleaning and re-building the solutions
  • Switching between Debug and Release configs
  • Switching between x64 and x86, and Any
  • The answer from this thread
  • Restarting VS
  • Creating a symbolic link (My code resides on a network share)
  • Ignoring the issue and designing in Blend
  • Adding ;assembly=MyAssembly

No matter what I do, it says "Invalid Markup". I cannot copy the project to my desktop to develop since my desktop is running Deep Freeze.

MainWindow.xaml

1    <Window
2        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="SDB.MainWindow"
5        xmlns:local="clr-namespace:SDB"
6        Title="Application Test"
7        Width="1920"
8        WindowState="Maximized"
9        WindowStartupLocation="CenterScreen"
10       Loaded="Window_Loaded"
11       Icon="/Resources/icon_database2.png" Height="1145"
12       VerticalAlignment="Bottom">
13   <Window.Resources>
14       <local:IntToImageConverter x:Key="IntToImageConverter" />
15   </Window.Resources>

IntToImageConverter.cs

namespace SDB {

    public class IntToImageConverter {


    }
}
kryz
  • 79
  • 11
  • When you say your code resides on a network share. You mean you're editing code isn't on your local machine's C drive? You can expect no end of weird problems if the code you're not working with in visual studio is on some other remote computer. – Andy Jun 09 '20 at 14:35
  • @Andy That's correct. But it's unrealistic for me to copy the code to my local machine every day – kryz Jun 09 '20 at 15:23
  • 2
    Been a while since I tried it, but in my experience it's simply not viable developing against source which is purely on a server. You could automate copying the sln every day from a repository. No Git? You can't copy the solution to a usb and work on that? Could you put visual studio on a server and remote onto that? If none of the above then I suggest you find someone who'll change one of those stoppers and let you develop. – Andy Jun 09 '20 at 15:51
  • 1
    Try unloading the project, delete the bin and obj directories, reload the project and building – Athul Raj Jun 11 '20 at 02:30

0 Answers0