示例#1
0
        public ActionResult Execute()
        {
            var logger = new MessageLogger(messageWriter);
            var referencedAssemblies = configuration.ReferencedAssemblies ?? Enumerable.Empty <string>();
            var assemblyResolver     = new AssemblyResolver(referencedAssemblies, logger);

            var context = new ProcessorContext {
                Configuration        = configuration,
                ApplicationDirectory = Path.GetDirectoryName(GetType().Assembly.Location),
                Logger           = logger,
                Language         = WeavingHelper.ParseLanguage(configuration.ProjectType),
                AssemblyResolver = assemblyResolver,
                MetadataResolver = new MetadataResolver(assemblyResolver),
            };

            context.InputFile  = FileHelper.ExpandPath(configuration.InputFile);
            context.OutputFile = FileHelper.ExpandPath(configuration.OutputFile);
            if (string.IsNullOrEmpty(context.OutputFile))
            {
                context.OutputFile = context.InputFile;
            }

            using (context) {
                foreach (var stage in GetStages())
                {
                    var stageResult = ExecuteStage(context, stage);
                    if (stageResult != ActionResult.Success)
                    {
                        return(stageResult);
                    }
                }
            }

            return(ActionResult.Success);
        }
示例#2
0
        static WellKnown()
        {
            var thisAssembly   = typeof(WellKnown).Assembly.GetName();
            var publicKeyToken = thisAssembly.GetPublicKeyToken();

            OrmAssemblyFullName = string.Format(
                "{0}, Version={1}, Culture=neutral, PublicKeyToken={2}",
                OrmAssemblyShortName, thisAssembly.Version, WeavingHelper.FormatPublicKeyToken(publicKeyToken));

            XtensivePublicKeyToken = new ReadOnlyCollection <byte>(publicKeyToken);
        }
示例#3
0
 public void RegisterNetCoreAssembly(string name, string publicKeyToken)
 {
     netCoreAssemblies.Add(name, WeavingHelper.ParsePublicKeyToken(publicKeyToken));
 }
示例#4
0
 public void RegisterFrameworkAssembly(string name, string publicKeyToken)
 {
     frameworkAssemblies.Add(name, WeavingHelper.ParsePublicKeyToken(publicKeyToken));
 }