예제 #1
0
        public override FileSystemPath TryResolve(T4ResolvedPath path)
        {
            var absolutePath = path.TryResolveAbsolutePath();

            if (absolutePath != null)
            {
                return(absolutePath);
            }
            // Maybe the assembly name is missing extension?
            var pathWithExtension = path.ProjectFile.ParentFolder?.Location.TryCombine(path.ResolvedPath + ".dll");

            if (pathWithExtension == null)
            {
                return(null);
            }
            if (pathWithExtension.ExistsFile)
            {
                return(pathWithExtension);
            }
            return(null);
        }
예제 #2
0
        private VirtualFileSystemPath TryResolve([NotNull] T4ResolvedPath resolvedPath)
        {
            var asAbsolute = resolvedPath.TryResolveAbsolutePath();

            if (asAbsolute != null)
            {
                return(asAbsolute);
            }
            string resolved = Components.Value.CanBeNull?.Host?.ResolveAssemblyReference(resolvedPath.ResolvedPath);

            if (resolved == null)
            {
                return(null);
            }
            var path = VirtualFileSystemPath.Parse(resolved, InteractionContext.SolutionContext);

            if (path.IsAbsolute)
            {
                return(path);
            }
            return(null);
        }