`
gstarwd
  • 浏览: 1488357 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Visual Studio的 诡异bug(mscorlib无法引用)引发的对话 and Silverlight XAML 构造出错

阅读更多

 

 

 

 

 

 

 

 

mscorlib无法引用

 

 

 

 

 

gy 

20:49:18
辛苦啦,不过友情提醒下~前辈的Silverlight用法不太规范的说~~
熙望 
20:49:42
呵呵。。  
熙望 
20:49:47
不会的。。
gy 
20:50:08
前辈的布局绝对化比较严重的说,这样不太好哦
熙望 
20:50:21
我最近布局绝对化 啥意思?
熙望 
20:50:23
请指教。
gy 
20:50:58
就是说,页面的控件定位大部分使用的是绝对坐标,建议前辈采用相对坐标或者动态布局的模式比较好~个人建议~
熙望 
20:51:10
呵呵 恩恩 知道了
熙望 
20:51:17
<object id="obj_21" style="width: 581px; height: 274px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',88,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="581" height="274" src="UserDataImage:Image1%5C%5C(%24X%5D%PP%24MAEN%7DB7N6K)(9WS.jpg"> </object>
熙望 
20:51:25
呵呵  又出来个其他问题。
gy 
20:51:31
恩~?
gy 
20:51:50
嗯,这个是SL常见的问题
熙望 
20:51:53
哇~
熙望 
20:51:56
呵呵 厉害
gy 
20:51:59
就是说明XAML代码中出现错误的说
gy 
20:52:17
常见的原因是涉及到绑定的代码有些问题
熙望 
20:52:21
哦哦~
gy 
20:53:25
或者如果控件的构造过程中发生异常也有可能
gy 
20:53:33
由于看不到前辈有使用绑定的地方
熙望 
20:53:40
恩恩。
gy 
20:53:45
请前辈对MainPage的构造方法进行一下调试
熙望 
20:53:56
ok
gy 
21:03:40
前辈解决问题了吗?
熙望 
21:03:54
呵呵  还在看哪里xaml错了
熙望 
21:04:01
我新手 呵呵
<object id="obj_22" style="width: 16px; height: 16px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',105,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="16" height="16" src="platformres:Misc%5C%5CBlueBar001.png"> </object> 21:04:03
您发送了一个窗口抖动。
gy 
21:04:24
好~加油~
<object id="obj_23" style="width: 16px; height: 16px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',107,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="16" height="16" src="platformres:Misc%5C%5CBlueBar001.png"> </object> 21:04:30
您发送了一个窗口抖动。
熙望 
21:04:30
呵呵  恩恩~~~~
gy 
21:04:34
XAML代码本身应该是不太会错的,否则编辑器会提示错误
熙望 
21:04:40
恩。。额 
gy 
21:04:44
怎么啦~前辈不要总是振我啦~~^^
熙望 
21:04:49
那就不知道 哪里错了 = =
gy 
21:05:07
调试一下MainPage的构造过程可以吗?
熙望 
21:05:12
熙望 
21:05:18
设断点吗?
gy 
21:05:43
嗯~
熙望 
21:07:10
恩  <object id="obj_24" style="width: 738px; height: 328px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',117,1,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="738" height="328" src="UserDataImage:Image1%5C%5CP8@%60NHI(D1ET%24Q3%Z6~J_0V.jpg"> </object>

就是这里下不去了。
熙望 
21:07:24
不知 怎么继续?
gy 
21:07:30
恩,那说明还是XAML代码的问题
熙望 
21:07:46
恩 语法错误之外的。
gy 
21:07:53
我帮前辈看一下吧~
熙望 
21:07:58
<object id="obj_25" style="width: 24px; height: 24px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',122,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="24" height="24" src="UserDataCustomFace:0%5C%5CA~4C%60V1H@WHI@YI2%24%60%5DR%5BB8.gif"> </object>
熙望 
21:08:01
谢谢
熙望 
21:08:18
我想知道您怎么找到 那个错误的 呵呵
熙望 
21:08:24
找到之后告诉我一下
熙望 
21:11:29
<object id="obj_26" style="width: 594px; height: 411px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',126,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="594" height="411" src="UserDataImage:Image1%5C%5COF2B(JT39L6PC%5B~7Q%24IU8)P.jpg"> </object>
这个是我后来加上去的。。
之前都可以运行的
gy 
21:11:48
加上去就不行了吗?
熙望 
21:12:22
恩。。还有相关部分的cs代码
熙望 
21:12:56
        <StackPanel Grid.Column="4" Height="404" HorizontalAlignment="Left" Name="stackPanel1" VerticalAlignment="Top" Width="283" >
            <Button Click="BingSearch">Bing搜索</Button>
            <TextBox x:Name="btnBingQuery" Height="40" Text="TextBlock" Width="282" />
            <ListBox  Grid.Column="4" Height="252"  x:Name="lstSearchPanel"  Width="282" />
        </StackPanel>
gy 
21:13:39
如果把这个部分注释掉
gy 
21:13:41
可以工作吗?  
熙望 
21:14:33
额 注释 了 还是不行。。
熙望 
21:14:49
<object id="obj_27" style="width: 594px; height: 369px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',133,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="594" height="369" src="UserDataImage:Image1%5C%5CSRI0C%7DF5ARSCSQK%ELGKHLH.jpg"> </object>
熙望 
21:14:53
还是这个错误
gy 
21:15:41
最好的方式还是一段段注释
gy 
21:15:45
我觉得那个map可能有问题
gy 
21:15:49
请前辈把他注释掉
gy 
21:15:53
看看能工作吗?


熙望 
21:16:00
  <Button x:Name="popup_disappeear" Click="PopUpPanel_MouseLeftButtonDown" >Close</Button>

我加了这个 我先看看这个注释掉 能行不
gy 
21:16:12
gy 
21:16:19
嗯……
熙望 
21:16:33
map 之前可以运行的
熙望 
21:17:00
呵呵 问题出在   <Button x:Name="popup_disappeear" Click="PopUpPanel_MouseLeftButtonDown" >Close</Button>
熙望 
21:17:10
呵呵 我对popup理解不深
熙望 
21:17:17
在里面乱加 东西 的缘故吧
gy 
21:18:05
Setting the Child property of Popup to a control with an x:Name attribute causes an exception when you create more than one instance of the Popup. 
gy 
21:18:23
Popup里面的元素不能指定名字
熙望 
21:18:28
哦 这样哦。
gy 
21:18:48
Popup是弹出的对象
gy 
21:18:52
所以一个界面上可能有多个
gy 
21:19:01
如果内容中的控件有名字,就会造成这个名字出现多次
熙望 
21:19:04
哦  。。
gy 
21:20:25
熙望 
21:20:30
<object id="obj_28" style="width: 45px; height: 45px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',154,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="45" height="45" src="UserDataCustomFace:0%5C%5C%WZ3UICIAY7%24D8V%7DP%7DW%606L6.gif"> </object>
gy 
21:20:44
前辈好可爱啊~~
熙望 
21:20:49
<object id="obj_29" style="width: 45px; height: 41px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',156,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="45" height="41" src="UserDataCustomFace:0%5C%5C)V%5B%24KBOY_)%5B8(%60YU3B~5%NB.gif"> </object>
熙望 
21:21:36
 <Popup x:Name="MyPopup"  Margin="539,354,78,0" 
     VerticalAlignment="Top" Height="320" Grid.ColumnSpan="3" Grid.Column="1" >
            <Border  BorderBrush="MediumBlue" BorderThickness="5">
            
                <StackPanel   Background="#FFB9F4E2" Height="Auto" Width="Auto"  >
                    <Button   Click="PopUpPanel_MouseLeftButtonDown" >Close</Button>

                    <TextBox Height="23" Name="ViewportPoint_x" Width="120" />
                    <TextBox Height="23" Name="ViewportPoint_y" Width="120" />
                    <ListBox  Background="Bisque" FontSize="15" Cursor="Arrow">
                        <TextBox Height="23" Name="lViewportPoint_x" Width="120" />
                        <TextBox Height="23" Name="lViewportPoint_y" Width="120" />

                    </ListBox>
                   
                </StackPanel>
           
            </Border>
        </Popup>
熙望 
21:21:49
现在这样还是不行哦 呵呵

熙望 
21:22:00
  <Button   Click="PopUpPanel_MouseLeftButtonDown" >Close</Button>
加了这个就是不行。
gy 
21:22:03
吧Popup的名字也去掉吧?
熙望 
21:22:02
好像
gy 
21:22:10
恩,我看看哦
熙望 
21:22:10
哦哦
熙望 
21:22:36
<object id="obj_30" style="width: 417px; height: 105px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',164,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="417" height="105" src="UserDataImage:Image1%5C%5CXTZRA79O8%7D%7D)3SYMV~53%(Q.jpg"> </object>
熙望 
21:22:42
去掉名字之后。
gy 
21:23:18
gy 
21:23:21
代码出问题了~
gy 
21:23:26
不过这个名字很必须吗?
熙望 
21:23:57
是设置 他的位置
熙望 
21:24:03
和  可见否的
熙望 
21:24:26
             MyPopup.SetValue(System.Windows.Controls.Primitives.Popup.VerticalOffsetProperty, (double)0);
             MyPopup.SetValue(System.Windows.Controls.Primitives.Popup.HorizontalOffsetProperty, (double)0);
熙望 
21:24:35
        private void PopUpPanel_MouseLeftButtonDown(object sender,MouseEventArgs e )
        {
            MyPopup.IsOpen = false; 
        }
gy 
21:26:20
好奇怪我
gy 
21:26:21
熙望 
21:26:20
恩恩
熙望 
21:26:32
那就不加 那个 button 了呵呵
熙望 
21:27:11
 我想实现  点击那个按钮 popup 就 消失
熙望 
21:27:14
呵呵
gy 
21:27:30
按道理来说,这样应该是没问题的说
熙望 
21:27:31
恩。。
熙望 
21:27:33
呵呵
gy 
21:31:05
话说,为什么要把Popup放在控件的路径里面呢
gy 
21:31:10
把它放到资源里面可以吗?
熙望 
21:31:41
额  我是新手 呵呵  应该您比较清楚吧   我只是实现那个效果就可以了。
熙望 
21:31:42
呵呵
熙望 
21:31:45
但是哦
gy 
21:31:51
恩?
熙望 
21:31:49
我去掉那个button
熙望 
21:32:00
加上其他代码之后 也还是出错
gy 
21:33:17
能具体些吗?
熙望 
21:34:34
就是去掉这个   <Button   Click="PopUpPanel_MouseLeftButtonDown" >Close</Button>

注释掉

<object id="obj_31" style="width: 471px; height: 48px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',191,1,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="471" height="48" src="UserDataImage:Image1%5C%5C7%60RHDCLYWVGJEZE~39%7B%7B%4M.jpg"> </object>

<object id="obj_32" style="width: 474px; height: 114px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',191,3,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="474" height="114" src="UserDataImage:Image1%5C%5C@GTL@7MECQ4HQHVDPCEPC8D.jpg"> </object>

<object id="obj_33" style="width: 410px; height: 236px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',191,5,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="410" height="236" src="UserDataImage:Image1%5C%5CTCR5%5D51H4(_~Y%5DLF41U%24E73.jpg"> </object>

是可以运行的
熙望 
21:34:58
但是我把 <object id="obj_34" style="width: 471px; height: 48px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',192,1,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="471" height="48" src="UserDataImage:Image1%5C%5C7%60RHDCLYWVGJEZE~39%7B%7B%4M.jpg"> </object>

<object id="obj_35" style="width: 474px; height: 114px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',192,3,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="474" height="114" src="UserDataImage:Image1%5C%5C@GTL@7MECQ4HQHVDPCEPC8D.jpg"> </object>

<object id="obj_36" style="width: 410px; height: 236px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',192,5,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="410" height="236" src="UserDataImage:Image1%5C%5CTCR5%5D51H4(_~Y%5DLF41U%24E73.jpg"> </object>

这些加回去之后 还是不能运行
熙望 
21:35:06
还是构造出错。。
gy 
21:36:34
Silverlight does not support simple inline XAML content. For example, you cannot specify content for a button by doing this: <Button>My button content</Button>. Instead, you must use the Content property like this: <Button Content="My button content" />.
gy 
21:36:38
这个问题可能是关键
熙望 
21:36:55
呵呵  哦
熙望 
21:37:00
原来这样啊
熙望 
21:37:09
<object id="obj_37" style="width: 628px; height: 115px;" onmouseup="javascript:if(event.button==1){}else if(event.button==2){OnRClickImage('platformres:Misc\\errorBmp.gif',198,0,0);}" classid="clsid:87AF538B-F052-4A0B-BAE0-E686AD921119" width="628" height="115" src="UserDataImage:Image1%5C%5CU5INM8%24GU%5B~VV8OJ_%5D%7DIX%24N.jpg"> </object>
熙望 
21:37:14
我试试!
gy 
21:37:21

相关推荐

    Visual Studio的 诡异bug(mscorlib无法引用)

    NULL 博文链接:https://gstarwd.iteye.com/blog/561828

    微软Visual Studio 开发核心库mscorlib.dll源代码,我们写代码经常用到的重要方法的源代码都在此

    微软Visual Studio开发核心库mscorlib.dll源代码,是你了解底层代码最好的一个资源,如含有string类中的各种方法,我们经常用到的方法的代码全在此!!是增强你内功的一个非常好的资源!!

    mscorlib.dll-resources.dat

    mscorlib.dll-resources.dat

    mscorlib和tlb.zip

    2. Type CMD and press Enter (or if you use Windows ME, type COMMAND). 3. Type regsvr32 "filename".dll and press Enter. If you have any other problems, see our HELP-section at www.dll-files.com

    .net 源代码 反编译成功的基础核心库 【mscorlib】

    .net 源代码 反编译成功的基础核心库 【mscorlib】 mscorlib.dll

    mscorlib.tlb

    用于sql server 2005企业管理器提示缺少mscorlib.tlb文件

    Newtonsoft.Json.Net 包括: .NET 2, .NET 3.5, .NET 4, .NET 4.5

    Newtonsoft.Json.Net 包括: .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store,所有dll文件和源码,有需要的同学可以直接下载。 个人网站多多支持:www.mlyuansu.com

    mscorlib.zip

    momo命名空间的Lua文件。用于IDEA智能提示..

    好用的反编译工具.NET Reflector 6.1.0.11(截至2010.08.19最新版)

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    反编译工具.NET Reflector 6.5.0.135

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    Reflector 7.5.4 带注册机和说明文件

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    好用的反编译工具.NET Reflector 6.6.0.30(截至2011.04.20最新版)

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    Reflector6.5升级后最新版

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    Reflector 6.5.0.135

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    Reflector 6..6.0.30

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    .NET Reflector 7.0.0.420 Crack

     有了Reflector.VisualStudio插件(正版,下面是根据在线资料介绍),Reflector可以寄在Visual Studio中Reflector不仅是一个对象浏览器、反汇编器,包裹在同一个程序中的所有功能还可以寄于Visual Studio中。...

    [笔记附件]VisionPro工具含义与编程引用命名空间路径列表.pdf

    VisionPro工具中文含义与对应编程命名空间路径列表

    RAD Studio 10.2 Toyko Update2 10.2.2 KEYGEN 亲测可用

    RAD Studio 10.2 Toyko Update2 10.2.2 KEYGEN 一键激活,安装时选择试用,安装完毕后一键激活即可。亲测可用!! Win10 Build 16299 旗舰版 亲测可用!!! 为了便于在 Lite 14.x 中使用大侠们的特别补丁,初步写成...

    Reflector 5.1.6.0 最新破解版

     如今,在Visual studio中编译源代码(无论是VB还是C#)时,编译器都会将高级源代码翻译成MSIL,即“微软中间语言”,而不是特定的机器指令。具有更多安全性、版本控制、共享能力与其它相关元数据的中间语言(IL),是...

Global site tag (gtag.js) - Google Analytics