Beispiel #1
0
        protected MsBuildProject?ResolveProject(string?project)
        {
            //builder.Register(c =>
            //{
            //    MsBuildProject msBuild = MsBuildProject.FromFileOrDirectory(ProjectCollection.GlobalProjectCollection, fileOrDirectory);
            //    return new DotNetProjectInformationProvider(msBuild);
            //}).As<IProjectInformationProvider>();

            if (project == null)
            {
                project = Directory.GetCurrentDirectory();
                project = PathUtility.EnsureTrailingSlash(project);
            }

            try
            {
                return(MsBuildProject.FromFileOrDirectory(ProjectCollection.GlobalProjectCollection, project));
            }
            catch
            {
                return(null);
            }
        }