Beispiel #1
0
        public NetFrameworkConsoleApplicationCsProj(string assemblyName, NetFrameworkPlatform targetFrameworkVersion, string rootNamespace = "") :
            base(assemblyName, "Exe", targetFrameworkVersion, rootNamespace)
        {
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Debug", "Any CPU"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Release", "Any CPU"));

            AddFileToFolder(new AppConfigFile(targetFrameworkVersion));
        }
Beispiel #2
0
        //public AppConfigFile(NetFrameworkVersion netFrameworkVersion) : this(netFrameworkVersion.ToString()) { }

        public AppConfigFile(NetPlatform netPlatformVersion) : base("App")
        {
            var supportedRuntimeNode = new XElement("supportedRuntime");

            if (netPlatformVersion is NetFrameworkPlatform)
            {
                NetFrameworkPlatform frameworkVersion = netPlatformVersion as NetFrameworkPlatform;

                supportedRuntimeNode.SetAttributeValue("version", frameworkVersion.RuntimeVersion);

                if (!String.IsNullOrEmpty(frameworkVersion.SKU))
                {
                    supportedRuntimeNode.SetAttributeValue("sku", frameworkVersion.SKU);
                }
            }

            var configNode = new XElement("configuration",
                                          new XElement("startup",
                                                       supportedRuntimeNode
                                                       //new XElement("supportedRuntime",
                                                       //    new XAttribute("version", "v4.0"),
                                                       //    new XAttribute("sku", ".NETFramework,Version=v4.5.2")
                                                       //)
                                                       )
                                          );

            using (var memoryStream = new MemoryStream())
            {
                configNode.Save(memoryStream);

                memoryStream.Position = 0;
                using (var streamReader = new StreamReader(memoryStream))
                {
                    FileContents = streamReader.ReadToEnd();
                }
            }
        }
 public NetFrameworkProject(string assemblyName, Guid assemblyGuid, string outputType, NetFrameworkPlatform targetFrameworkVersion, string rootNamespace = "") :
     base(assemblyName, assemblyGuid, outputType, targetFrameworkVersion, rootNamespace)
 {
     AddDefaultAssemblyReferences();
     AddDefaultFoldersAndFiles();
 }
 public NetFrameworkProject(string assemblyName, string outputType, NetFrameworkPlatform targetFrameworkVersion, string rootNamespace = "") :
     this(assemblyName, Guid.NewGuid(), outputType, targetFrameworkVersion, rootNamespace)
 {
 }
 public NetFrameworkClassLibraryProject(string assemblyName, NetFrameworkPlatform targetFrameworkVersion, string rootNamespace = "") :
     base(assemblyName, "Library", targetFrameworkVersion, rootNamespace)
 {
     SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Debug", "Any CPU"));
     SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Release", "Any CPU"));
 }
Beispiel #6
0
        public static SolutionWizard With_NetFrameworkClassLibrary(this SolutionWizard wizard, string assemblyName, NetFrameworkPlatform targetFrameworkVersion)
        {
            Project newProj = new NetFrameworkClassLibraryProject(assemblyName, targetFrameworkVersion);

            newProj.AddFileToFolder(new ProjectFile(SolutionWizard.CreateEmpty_NetFramework_ClassFile(assemblyName)));

            wizard.WithProject(newProj);

            return(wizard);
        }
Beispiel #7
0
        public static SolutionWizard With_NetFrameworkConsoleApplication(this SolutionWizard wizard, string assemblyName, NetFrameworkPlatform targetFrameworkVersion)
        {
            Project newConsoleApp = new NetFrameworkConsoleApplicationCsProj(assemblyName, targetFrameworkVersion);

            newConsoleApp.AddFileToFolder(new AppConfigFile(targetFrameworkVersion));
            newConsoleApp.AddFileToFolder(new ProjectFile(SolutionWizard.CreateDefault_NetFramework_ConsoleProgram(assemblyName)));

            wizard.WithProject(newConsoleApp);

            return(wizard);
        }