由于 System.Web 异常,WPF 设计器无法加载!

发布于 2024-11-27 06:29:27 字数 2310 浏览 1 评论 0原文

我的 wpf 设计器无法加载,因为它说找不到程序集 System.web,而且我不知道 wpf 与 System.web 有什么关系

错误射击

有什么想法吗?

这是 XAML 页面之一:

<UserControl x:Class="RadinFarazJamAutomationSystem.UserControls.ctrlPriceManagement"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" Height="200" Loaded="UserControl_Loaded" Width="300" FlowDirection="RightToLeft" d:DesignWidth="300">
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="1*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="165*" />
    </Grid.RowDefinitions>
    <Button Content="ثبت" Grid.Row="3" Height="23" HorizontalAlignment="Left" Margin="5" Name="btnSave" VerticalAlignment="Center" Width="80" Click="btnSave_Click" Grid.Column="1" />
    <Label Content="نرخ دلار"  HorizontalAlignment="Left" Margin="5" VerticalAlignment="Center" />
    <Label Content="درصد سود مشتری" Grid.Row="1" Height="28" HorizontalAlignment="Left" Margin="5" VerticalAlignment="Center" />
    <Label Content="درصد سود همکار" Grid.Row="2" Margin="5" VerticalAlignment="Center" />
    <TextBox Grid.Column="1"  HorizontalAlignment="Stretch" Margin="5" Name="txtDollarPrice" VerticalAlignment="Center"  />
    <TextBox Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Name="txtCustomerProfit" VerticalAlignment="Top" />
    <TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Stretch" Margin="5" Name="txtColleagueProfit" VerticalAlignment="Top" />
</Grid>

但这与xaml无关,因为每个页面都有相同的错误。一切都很好,有一天我在每一页上都看到这个错误,但我不知道我做了什么可能导致这个错误。

My wpf designer fails to load because it says it cannot find assembly System.web and I don't have any idea what wpf has to do with System.web

Error Shot

Any Idea ?

Here is one of the XAML Pages :

<UserControl x:Class="RadinFarazJamAutomationSystem.UserControls.ctrlPriceManagement"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" Height="200" Loaded="UserControl_Loaded" Width="300" FlowDirection="RightToLeft" d:DesignWidth="300">
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="1*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="165*" />
    </Grid.RowDefinitions>
    <Button Content="ثبت" Grid.Row="3" Height="23" HorizontalAlignment="Left" Margin="5" Name="btnSave" VerticalAlignment="Center" Width="80" Click="btnSave_Click" Grid.Column="1" />
    <Label Content="نرخ دلار"  HorizontalAlignment="Left" Margin="5" VerticalAlignment="Center" />
    <Label Content="درصد سود مشتری" Grid.Row="1" Height="28" HorizontalAlignment="Left" Margin="5" VerticalAlignment="Center" />
    <Label Content="درصد سود همکار" Grid.Row="2" Margin="5" VerticalAlignment="Center" />
    <TextBox Grid.Column="1"  HorizontalAlignment="Stretch" Margin="5" Name="txtDollarPrice" VerticalAlignment="Center"  />
    <TextBox Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" Name="txtCustomerProfit" VerticalAlignment="Top" />
    <TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Stretch" Margin="5" Name="txtColleagueProfit" VerticalAlignment="Top" />
</Grid>

but this is not related to xaml because every page has the same error . Everything was fine when one day I see this error in every page and I don't know what did i do that might caused this error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

狂之美人 2024-12-04 06:29:27

只是猜测,但您的项目是否针对 .Net Framework 的客户端配置文件?如果您尝试使用其中未包含的类型,那么您可能会看到与此类似的错误。

http://msdn.microsoft.com/en-us/library/cc656912.aspx

Just a guess but could it be that your project is targeting the client profile of the .Net Framework? If you are attempting to use types that are not included there then you would probably see an error similar to this.

http://msdn.microsoft.com/en-us/library/cc656912.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文