VS2010 C# 遇到的一些问题

#编译时提示“不能使用 fixed 语句来获取已固定的表达式的地址”

  出错的代码

private static unsafe uint smethod_12(byte[] byte_0, uint uint_0, byte[] byte_1)
        {
            byte[] buffer;
            if (((buffer = byte_0) != null) && (buffer.Length != 0))
            {
                numRef = buffer;
                goto Label_001A;
            }
            fixed (byte* numRef = null)
            {
                byte[] buffer2;

   改为

  

        private static unsafe uint smethod_12(byte[] byte_0, uint uint_0, byte[] byte_1)
        {
            byte[] buffer;
            if (((buffer = byte_0) != null) && (buffer.Length != 0))
            {
                numRef = buffer;
                goto Label_001A;
            }
            fixed (byte* numRef = buffer)
            {
                byte[] buffer2;

 参考msdn

 

#REFLECTOR反编译.NET文件后MANAGER,BASE.AUTOSCALEMODE修复

参考

 

#无法调试,出错信息如下:

  1. 尝试初始化开发环境:

    开始菜单打开:Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Studio 2010 命令提示

    在窗口中输入:devenv /resetuserdata

    重启vs进行初始环境配置选择。

  2. 参考

#不安全代码只会在使用/unsafe 编译的情况

  如下图配置项目属性即可通过编译
  

 

#如何显示行号?

  如下图所示配置“工具/选项”选项即可:

  

 

posted @ 2016-09-12 11:21  树.Code  阅读(469)  评论(0编辑  收藏  举报