コード例 #1
0
        void AddConfiguration(string name)
        {
            var configuration = new DnxProjectConfiguration(name);

            Configurations.Add(configuration);

            EnsureConfigurationHasProjectInstance(configuration);
        }
コード例 #2
0
        /// <summary>
        /// HACK. The Configuration needs to have the ProjectInstance set otherwise the
        /// Project's OnDispose method throws a NullReferenceException if a new DNX project
        /// is created but not when it is loaded from disk. The DNX addin is
        /// bypassing the normal load and save methods used by the Project class so
        /// the ProjectInstance is never set. Another problem is the ProjectInstance
        /// is internal so the DNX addin has to resort to reflection to set this.
        /// </summary>
        void EnsureConfigurationHasProjectInstance(DnxProjectConfiguration configuration)
        {
            Type         type     = configuration.GetType();
            PropertyInfo property = type.GetProperty("ProjectInstance", BindingFlags.Instance | BindingFlags.NonPublic);

            if (property != null)
            {
                object instance = property.GetValue(configuration);
                if (instance == null)
                {
                    property.SetValue(configuration, MSBuildProject.CreateInstance());
                }
            }
        }
コード例 #3
0
        void AddConfiguration(string name)
        {
            var configuration = new DnxProjectConfiguration(name);

            Configurations.Add(configuration);
        }
コード例 #4
0
 void AddConfiguration(string name)
 {
     var configuration = new DnxProjectConfiguration (name);
     Configurations.Add (configuration);
 }