diff --git a/Src/Asp.Net/SugarCodeGeneration/Codes/Methods.cs b/Src/Asp.Net/SugarCodeGeneration/Codes/Methods.cs index 6e0ba0938..a0c796632 100644 --- a/Src/Asp.Net/SugarCodeGeneration/Codes/Methods.cs +++ b/Src/Asp.Net/SugarCodeGeneration/Codes/Methods.cs @@ -14,6 +14,7 @@ namespace SugarCodeGeneration.Codes /// public class Methods { + public static Dictionary ProjectIds = new Dictionary(); public static string GetCurrentProjectPath { @@ -47,6 +48,7 @@ namespace SugarCodeGeneration.Codes XElement itemGroup = new XElement("ItemGroup"); itemGroup.Add(new XElement("Name", refProjectName)); + itemGroup.Add(new XElement("Project", "{" + ProjectIds[refProjectName] + "}")); itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", string.Format(@"..\{0}\{0}.csproj", refProjectName)))); root.Add(itemGroup); @@ -136,6 +138,7 @@ namespace SugarCodeGeneration.Codes FileHelper.CreateFile(projectPath, project, System.Text.Encoding.UTF8); FileHelper.CreateFile(projectDic + "\\class1.cs", "", System.Text.Encoding.UTF8); //没成功File.Copy(GetCurrentProjectPath + "/Template/nuget.txt", projectDic + "packages.config"); + ProjectIds.Add(name, projectId); AppendProjectToSln(projectId, name); } }