예제 #1
0
        public static IXProject GetXProject(this DProject prj, IXProjectEnv env, bool tryLoad = true)
        {
            if (prj == null || env == null)
            {
                return(null);
            }

            var cfg = new ConfigItem(
                prj.GetActiveConfig(),
                prj.GetActivePlatform()
                );

            if (!tryLoad)
            {
                return(env.XProjectByFile(prj.FullName, cfg, false));
            }

            // similar problems -MS Connect Issue #508628:
            // http://connect.microsoft.com/VisualStudio/feedback/details/508628/

            return(env.XProjectByFile(prj.FullName, cfg, prj.GetProjectProperties(env)));
        }
예제 #2
0
        public static IDictionary <string, string> GetProjectProperties(this DProject prj, IXProjectEnv env = null)
        {
            var p = env == null ? new Dictionary <string, string>() : new Dictionary <string, string>(env.Sln.Properties)
            {
                [PropertyNames.CONFIG]   = prj.GetActiveConfig(),
                [PropertyNames.PLATFORM] = prj.GetActivePlatform(),
                [PropertyNames.PRJ_GUID] = prj.GetProjectGuid(),
                [PropertyNames.VS_BUILD] = "true",
            };

            if (!p.ContainsKey(PropertyNames.CODE_ANAL_ORUN))
            {
                p[PropertyNames.CODE_ANAL_ORUN] = "false";
            }

            if (!p.ContainsKey(PropertyNames.DEVENV_DIR))
            {
                p[PropertyNames.DEVENV_DIR] = "".GetDevEnvDir();
            }

            return(p);
        }