diff --git a/Changelog.md b/Changelog.md index f8eb18ec2..6d28a55ea 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,28 @@ +# 5.3.1 with EFCore 2.0.2 and AspNetCore 0.3.0 + +* Code Generation + * Switch to using Mono.Cecil to parse pdb files during code generation (#410) + This should make it possible to use portable and embedded pdb's on the server + * +* AspNetCore + * New extension method to add OpenRiaServices to services from #413 by @ehsangfl. + ```C# + services.AddOpenRiaServices() + ``` + * New extension method to add OpenRiaServices to pipeline from #413 by @ehsangfl. + ```C# + endpoints.MapOpenRiaServices(opt => opt.AddDomainService()) + ``` + * Add Net7 build target to support "Finally Conventions" (`IEndpointConventionBuilder.Finally`) + * Add `OpenRiaServices.Server.DomainOperationEntry` to endpoint metadata + * This allows end user to easier implement additional conventions (such as Open Api or similar) + * Copy `AuthorizationAttribute`s to endpoint metadata for queries and invokes to support [AspNetCore Authorization](https://learn.microsoft.com/en-us/aspnet/core/security/authorization/simple?view=aspnetcore-7.0) + * Attributes can be set on either method or class level + * Fixed serialization of sizes larger than 1 GB + +*Other* +- Updated nuget packages + # 5.3.0 with EFCore 2.0.1 * Fix shadow property issue in EF Core DB Context extensions (#397): diff --git a/NuGet/OpenRiaServices.Client.CodeGen/OpenRiaServices.Client.CodeGen.nuspec b/NuGet/OpenRiaServices.Client.CodeGen/OpenRiaServices.Client.CodeGen.nuspec index 3cf8eb732..61e4a5b63 100644 --- a/NuGet/OpenRiaServices.Client.CodeGen/OpenRiaServices.Client.CodeGen.nuspec +++ b/NuGet/OpenRiaServices.Client.CodeGen/OpenRiaServices.Client.CodeGen.nuspec @@ -21,8 +21,9 @@ - - - + + + + \ No newline at end of file diff --git a/NuGet/OpenRiaServices.Client.Core.nuspec b/NuGet/OpenRiaServices.Client.Core.nuspec index 41acf2f5b..affae8933 100644 --- a/NuGet/OpenRiaServices.Client.Core.nuspec +++ b/NuGet/OpenRiaServices.Client.Core.nuspec @@ -21,8 +21,8 @@ - - + + diff --git a/NuGet/OpenRiaServices.Hosting.Wcf/OpenRiaServices.Hosting.Wcf.nuspec b/NuGet/OpenRiaServices.Hosting.Wcf/OpenRiaServices.Hosting.Wcf.nuspec index 93cf99145..4df76c2cb 100644 --- a/NuGet/OpenRiaServices.Hosting.Wcf/OpenRiaServices.Hosting.Wcf.nuspec +++ b/NuGet/OpenRiaServices.Hosting.Wcf/OpenRiaServices.Hosting.Wcf.nuspec @@ -22,7 +22,7 @@ - + diff --git a/NuGet/OpenRiaServices.Server/OpenRiaServices.Server.nuspec b/NuGet/OpenRiaServices.Server/OpenRiaServices.Server.nuspec index 5445c6e7d..9563db818 100644 --- a/NuGet/OpenRiaServices.Server/OpenRiaServices.Server.nuspec +++ b/NuGet/OpenRiaServices.Server/OpenRiaServices.Server.nuspec @@ -29,11 +29,11 @@ - + - + diff --git a/NuGet/OpenRiaServices.T4.nuspec b/NuGet/OpenRiaServices.T4.nuspec index 03baf9dc1..d99cfc93a 100644 --- a/NuGet/OpenRiaServices.T4.nuspec +++ b/NuGet/OpenRiaServices.T4.nuspec @@ -17,7 +17,7 @@ WCF RIA Services RIAServices T4 OpenRiaServices - + diff --git a/README.md b/README.md index 47815cf44..ea408dc9f 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,11 @@ Here are the most common nuget packages and their current versions. | OpenRiaServices.T4 | [![NuGet](https://img.shields.io/nuget/v/OpenRiaServices.T4.svg)](https://www.nuget.org/packages/OpenRiaServices.T4) | [![NuGet](https://img.shields.io/nuget/vpre/OpenRiaServices.T4.svg)]() | | OpenRiaServices.Endpoints | [![NuGet](https://img.shields.io/nuget/v/OpenRiaServices.Endpoints.svg)](https://www.nuget.org/packages/OpenRiaServices.Endpoints) | [![NuGet](https://img.shields.io/nuget/vpre/OpenRiaServices.Endpoints.svg)](https://www.nuget.org/packages/OpenRiaServices.Endpoints) | +# Code of Conduct +This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. +For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). + +# .NET Foundation + +This project is supported by the [.NET Foundation](https://dotnetfoundation.org). diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4f2513e6c..37d10bc0e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,14 +10,21 @@ variables: steps: +# install dotnet 6 sdk so we can run tests against them - task: UseDotNet@2 inputs: packageType: 'sdk' version: '6.0.x' +# install dotet 7 sdk to allow compilation target +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '7.0.x' + - task: NuGetToolInstaller@1 inputs: - versionSpec: 6.3.0 + versionSpec: 6.5.0 - task: gitversion/setup@0 displayName: Install GitVersion diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 2d8cafcbd..ef3145c7d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -9,7 +9,7 @@ true - 10.0 + 11.0 True @@ -22,14 +22,16 @@ preview.5 --> 5.0.0.0 - Outercurve Foundation - Open RIA Services - Outercurve Foundation. All rights reserved. + .NET Foundation + OpenRiaServices + .NET Foundation $(MSBuildProjectName) https://github.com/OpenRIAServices/OpenRiaServices/ https://github.com/OpenRIAServices/OpenRiaServices.git true git + For release notes see https://github.com/OpenRIAServices/OpenRiaServices/releases + OpenRIAServices Apache-2.0 $(MSBuildThisFileDirectory)..\Nuget\bin @@ -40,8 +42,6 @@ true - For release notes see https://github.com/OpenRIAServices/OpenRiaServices/releases - Outercurve RIA Services true diff --git a/src/OpenRiaServices.Client.DomainClients.Http/Framework/OpenRiaServices.Client.DomainClients.Http.csproj b/src/OpenRiaServices.Client.DomainClients.Http/Framework/OpenRiaServices.Client.DomainClients.Http.csproj index 7174a70fd..21d25f0c5 100644 --- a/src/OpenRiaServices.Client.DomainClients.Http/Framework/OpenRiaServices.Client.DomainClients.Http.csproj +++ b/src/OpenRiaServices.Client.DomainClients.Http/Framework/OpenRiaServices.Client.DomainClients.Http.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenRiaServices.Client.Web/Framework/OpenRiaServices.Client.Web.csproj b/src/OpenRiaServices.Client.Web/Framework/OpenRiaServices.Client.Web.csproj index 68e9cb9c5..35e84cf73 100644 --- a/src/OpenRiaServices.Client.Web/Framework/OpenRiaServices.Client.Web.csproj +++ b/src/OpenRiaServices.Client.Web/Framework/OpenRiaServices.Client.Web.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/EndpointRouteBuilderExtensions.cs b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/EndpointRouteBuilderExtensions.cs index 89b21cc13..35c4ad847 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/EndpointRouteBuilderExtensions.cs +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/EndpointRouteBuilderExtensions.cs @@ -18,6 +18,15 @@ public static void AddOpenRiaServices(this IServiceCollection services) services.AddSingleton(); } + public static void AddOpenRiaServices(this IServiceCollection services) where T : OpenRiaServices.Server.DomainService + { + ArgumentNullException.ThrowIfNull(services); + + services.AddSingleton(); + + services.AddTransient(); + } + public static IEndpointConventionBuilder MapOpenRiaServices(this IEndpointRouteBuilder endpoints, Action configure) { return endpoints.MapOpenRiaServices(string.Empty, configure); diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesConfigurationBuilder.cs b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesConfigurationBuilder.cs index f52b72abf..db20f2b8d 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesConfigurationBuilder.cs +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesConfigurationBuilder.cs @@ -22,5 +22,14 @@ public void AddDomainService(Type type) _dataSource.DomainServices.Add(longName + "/binary", description); } + + public void AddDomainService() + { + var type = typeof(T); + var longName = type.FullName.Replace('.', '-') + ".svc"; + var description = DomainServiceDescription.GetDescription(type); + + _dataSource.DomainServices.Add(longName + "/binary", description); + } } } diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesEndpointDataSource.cs b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesEndpointDataSource.cs index 1d9adb4ae..212a0ea52 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesEndpointDataSource.cs +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/OpenRiaServicesEndpointDataSource.cs @@ -3,6 +3,8 @@ using System; using System.Collections.Generic; +using System.Reflection; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; @@ -16,14 +18,15 @@ namespace OpenRiaServices.Hosting.AspNetCore { internal class OpenRiaServicesEndpointDataSource : EndpointDataSource, IEndpointConventionBuilder { - private readonly List> _conventions; + private readonly List> _conventions = new(); + private readonly List> _finallyConventions = new(); public Dictionary DomainServices { get; } = new(); private List _endpoints; - public OpenRiaServicesEndpointDataSource(RoutePatternTransformer routePatternTransformer) + public OpenRiaServicesEndpointDataSource() { - _conventions = new List>(); + } public override IReadOnlyList Endpoints @@ -47,9 +50,18 @@ private List BuildEndpoints() var getOrPost = new HttpMethodMetadata(new[] { "GET", "POST" }); var postOnly = new HttpMethodMetadata(new[] { "POST" }); + foreach (var (name, domainService) in DomainServices) { var serializationHelper = new SerializationHelper(domainService); + List additionalMetadata = new List(); + foreach (Attribute attribute in domainService.Attributes) + { + if (CopyAttributeToEndpointMetadata(attribute)) + additionalMetadata.Add(attribute); + } + // Consider adding additional metadata souch as route groups etc + //endpointBuilder.Metadata.Add(new EndpointGroupNameAttribute(domainService)); foreach (var operation in domainService.DomainOperationEntries) { @@ -70,14 +82,14 @@ private List BuildEndpoints() else continue; - AddEndpoint(endpoints, name, invoker, hasSideEffects ? postOnly : getOrPost); + AddEndpoint(endpoints, name, invoker, hasSideEffects ? postOnly : getOrPost, additionalMetadata); } var submit = new ReflectionDomainServiceDescriptionProvider.ReflectionDomainOperationEntry(domainService.DomainServiceType, typeof(DomainService).GetMethod(nameof(DomainService.SubmitAsync)), DomainOperation.Custom); var submitOperationInvoker = new SubmitOperationInvoker(submit, serializationHelper); - AddEndpoint(endpoints, name, submitOperationInvoker, postOnly); + AddEndpoint(endpoints, name, submitOperationInvoker, postOnly, additionalMetadata); } @@ -85,16 +97,10 @@ private List BuildEndpoints() return endpoints; } - private void AddEndpoint(List endpoints, string domainService, OperationInvoker invoker, HttpMethodMetadata httpMethod) + private void AddEndpoint(List endpoints, string domainService, OperationInvoker invoker, HttpMethodMetadata httpMethod, List additionalMetadata) { var route = RoutePatternFactory.Parse($"{Prefix}/{domainService}/{invoker.OperationName}"); - // TODO: looka at adding authorization and authentication metadata to endpoiunt - // authorization - look for any attribute implementing microsoft.aspnetcore.authorization.iauthorizedata - // https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authorization.iauthorizedata?view=aspnetcore-6.0 - - //var aut = operation.Attributes.Cast().OfType().ToList(); - var endpointBuilder = new RouteEndpointBuilder( invoker.Invoke, route, @@ -103,14 +109,51 @@ private void AddEndpoint(List endpoints, string domainService, Operati DisplayName = $"{domainService}.{invoker.OperationName}" }; endpointBuilder.Metadata.Add(httpMethod); - //endpointBuilder.Metadata.Add(new EndpointGroupNameAttribute(domainService)); + endpointBuilder.Metadata.Add(invoker.DomainOperation); + + // Copy all AspNetCore Authorization attributes + foreach (Attribute attribute in invoker.DomainOperation.Attributes) + { + if (CopyAttributeToEndpointMetadata(attribute)) + endpointBuilder.Metadata.Add(attribute); + } + + // Try to add MethodInfo + //if (TryGetMethodInfo(invoker) is MethodInfo method) + //{ + // endpointBuilder.Metadata.Add(method); + //} + + foreach (var metadata in additionalMetadata) + endpointBuilder.Metadata.Add(metadata); + foreach (var convention in _conventions) { convention(endpointBuilder); } + + foreach (var finallyConvention in _finallyConventions) + finallyConvention(endpointBuilder); + endpoints.Add(endpointBuilder.Build()); } + private static bool CopyAttributeToEndpointMetadata(Attribute authorizeAttribute) + { + return authorizeAttribute is IAuthorizeData; + } + + private static MethodInfo TryGetMethodInfo(OperationInvoker invoker) + { + MethodInfo method = invoker.DomainOperation.DomainServiceType.GetMethod(invoker.DomainOperation.Name); + if (method == null && invoker.DomainOperation.IsTaskAsync) + { + method = invoker.DomainOperation.DomainServiceType.GetMethod(invoker.DomainOperation.Name + "Async"); + } + + return method; + } + public override IChangeToken GetChangeToken() { return NullChangeToken.Singleton; @@ -120,5 +163,12 @@ void IEndpointConventionBuilder.Add(Action convention) { _conventions.Add(convention); } + +#if NET7_0_OR_GREATER + void IEndpointConventionBuilder.Finally(System.Action finallyConvention) + { + _finallyConventions.Add(finallyConvention); + } +#endif } } diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Operations/OperationInvoker.cs b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Operations/OperationInvoker.cs index dc317d654..8393c039c 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Operations/OperationInvoker.cs +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Operations/OperationInvoker.cs @@ -49,6 +49,7 @@ protected OperationInvoker(DomainOperationEntry operation, DomainOperationType o } public virtual string OperationName => _operation.Name; + public DomainOperationEntry DomainOperation => _operation; public abstract Task Invoke(HttpContext context); diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Serialization/ArrayPoolStream.cs b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Serialization/ArrayPoolStream.cs index 5abdf6d46..407938e1b 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Serialization/ArrayPoolStream.cs +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/AspNetCore/Serialization/ArrayPoolStream.cs @@ -33,6 +33,9 @@ internal sealed class ArrayPoolStream : Stream public ArrayPoolStream(ArrayPool arrayPool, int maxBlockSize) { + if (maxBlockSize < 0) + throw new ArgumentOutOfRangeException(nameof(maxBlockSize), maxBlockSize, "Max size can not have a negative value"); + _arrayPool = arrayPool; _maxSize = maxBlockSize; } @@ -116,7 +119,23 @@ private void EnsureBufferCapacity() // Ensure we never return buffer twice in case TakeBuffer below throws _buffer = null; - int nextSize = Math.Min(_position * 2, _maxSize); + int nextSize = _position * 2; + // If the size is >1GB the next size might be larger than int.MaxValue + // which means it will become negative + if (nextSize < 0) + { + if (_position > 0 && _position < int.MaxValue) + { + //This is the space left before we hit max int + nextSize = int.MaxValue - _position; + } + else + { + throw new InsufficientMemoryException(); + } + } + + nextSize = Math.Min(nextSize, _maxSize); _buffer = _arrayPool.Rent(nextSize); _bufferWritten = 0; } diff --git a/src/OpenRiaServices.Hosting.AspNetCore/Framework/OpenRiaServices.Hosting.AspNetCore.csproj b/src/OpenRiaServices.Hosting.AspNetCore/Framework/OpenRiaServices.Hosting.AspNetCore.csproj index 4f25fcfb9..9a68ffeb3 100644 --- a/src/OpenRiaServices.Hosting.AspNetCore/Framework/OpenRiaServices.Hosting.AspNetCore.csproj +++ b/src/OpenRiaServices.Hosting.AspNetCore/Framework/OpenRiaServices.Hosting.AspNetCore.csproj @@ -1,12 +1,12 @@  - net6.0 + net6.0;net7.0 $(DefineConstants);SERVERFX;ASPNET_CORE OpenRiaServices.Hosting $(NoWarn);CS1574;CS1573;CS1591;CS1572 - 0.2.1 + 0.3.0 true Daniel-Svensson OpenRiaServices AspNetCore Hosting DomainServices AspNet WCF RIA Services Server @@ -40,8 +40,8 @@ - - + + diff --git a/src/OpenRiaServices.Hosting.Wcf/Framework/OpenRiaServices.Hosting.Wcf.csproj b/src/OpenRiaServices.Hosting.Wcf/Framework/OpenRiaServices.Hosting.Wcf.csproj index 6754c03ca..e66531131 100644 --- a/src/OpenRiaServices.Hosting.Wcf/Framework/OpenRiaServices.Hosting.Wcf.csproj +++ b/src/OpenRiaServices.Hosting.Wcf/Framework/OpenRiaServices.Hosting.Wcf.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/OpenRiaServices.Hosting.Wcf/Framework/Wcf/ChangeSetProcessor.cs b/src/OpenRiaServices.Hosting.Wcf/Framework/Wcf/ChangeSetProcessor.cs index 141aef7d2..eb8ed9d2c 100644 --- a/src/OpenRiaServices.Hosting.Wcf/Framework/Wcf/ChangeSetProcessor.cs +++ b/src/OpenRiaServices.Hosting.Wcf/Framework/Wcf/ChangeSetProcessor.cs @@ -203,7 +203,9 @@ private static void SetEntityAssociations(IEnumerable changeSetE HashSet visited = new HashSet(); foreach (var entityGroup in changeSetEntries.Where(p => (p.Associations != null && p.Associations.Count > 0) || (p.OriginalAssociations != null && p.OriginalAssociations.Count > 0)).GroupBy(p => p.Entity.GetType())) { +#pragma warning disable CS0618 // Type or member is obsolete: AssociationAttribute Dictionary associationMemberMap = TypeDescriptor.GetProperties(entityGroup.Key).Cast().Where(p => p.Attributes[typeof(AssociationAttribute)] != null).ToDictionary(p => p.Name); +#pragma warning restore CS0618 // Type or member is obsolete foreach (ChangeSetEntry changeSetEntry in entityGroup) { if (visited.Contains(changeSetEntry.Id)) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 62076cc16..09d3e075d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -3,8 +3,8 @@ net6.0;netstandard2.0 $(DefineConstants);SERVERFX;EFCORE true - 2.0.1 - 2.0.1 + 2.0.2 + 2.0.2 true LICENSE.md diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj index 222e18033..c26568d89 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj @@ -5,9 +5,9 @@ 1.0.0.0 - - - + + + diff --git a/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj b/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj index 20ff9e45e..236a87126 100644 --- a/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj +++ b/src/OpenRiaServices.Server/Framework/OpenRiaServices.Server.csproj @@ -18,12 +18,12 @@ - + - + diff --git a/src/OpenRiaServices.Tools/Framework/ClientCodeGenerationDispatcher.cs b/src/OpenRiaServices.Tools/Framework/ClientCodeGenerationDispatcher.cs index 2fb97c9c6..f6c2ecbf7 100644 --- a/src/OpenRiaServices.Tools/Framework/ClientCodeGenerationDispatcher.cs +++ b/src/OpenRiaServices.Tools/Framework/ClientCodeGenerationDispatcher.cs @@ -59,9 +59,11 @@ internal string GenerateCode(ClientCodeGenerationOptions options, SharedCodeServ AppDomainUtilities.ConfigureAppDomain(options); LoadOpenRiaServicesServerAssembly(parameters, loggingService); // Try to load mono.cecil from same folder as tools + // This prevents problem if server project contains another version of mono Cecil var toolingAssembly = typeof(ClientCodeGenerationDispatcher).Assembly; var cecilPath = toolingAssembly.Location.Replace(toolingAssembly.GetName().Name, "Mono.Cecil"); AssemblyUtilities.LoadAssembly(cecilPath, loggingService); + AssemblyUtilities.LoadAssembly(cecilPath.Replace("Mono.Cecil", "Mono.Cecil.Pdb"), loggingService); using (SharedCodeService sharedCodeService = new SharedCodeService(parameters, loggingService)) diff --git a/src/OpenRiaServices.Tools/Framework/OpenRiaServices.Tools.csproj b/src/OpenRiaServices.Tools/Framework/OpenRiaServices.Tools.csproj index e0d753749..7288055e6 100644 --- a/src/OpenRiaServices.Tools/Framework/OpenRiaServices.Tools.csproj +++ b/src/OpenRiaServices.Tools/Framework/OpenRiaServices.Tools.csproj @@ -1,9 +1,30 @@  - $(DefineConstants);SERVERFX;DBCONTEXT;NET40 + $(DefineConstants);SERVERFX;DBCONTEXT net472 + OpenRiaServices.Client.CodeGen + OpenRiaServices Client Code Generator + OpenRiaServices CodeGen provides the MsBuild Tasks to generate the client proxy. + WCF RIA Services RIAServices OpenRiaServices CodeGen + true + true + + + + $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage + + + tasks + + NU5100,NU5128 + + + true + + + .pdb @@ -18,15 +39,22 @@ + + + + + + + + False + + - - true - true @@ -45,19 +73,16 @@ OpenRiaServices.Tools + - - - - - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/PdbSourceFileProviderFactory.cs b/src/OpenRiaServices.Tools/Framework/Pdb/PdbSourceFileProviderFactory.cs deleted file mode 100644 index 2c079723a..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/PdbSourceFileProviderFactory.cs +++ /dev/null @@ -1,204 +0,0 @@ -namespace OpenRiaServices.Tools.SourceLocation -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.Diagnostics.SymbolStore; - using System.Globalization; - using System.Reflection; - using OpenRiaServices; - using OpenRiaServices.Tools.Pdb.SymStore; - using OpenRiaServices.Tools.SharedTypes; - - /// - /// PDB-based implementation of to locate source files for types or methods. - /// - internal class PdbSourceFileProviderFactory : ISourceFileProviderFactory - { - private readonly ILogger _logger; - private readonly string _symbolSearchPath; - - /// - /// Creates a new instance. - /// - /// Optional list of semicolon separated paths to search for PDB files. - /// Optional logger to use to report errors or warnings. - public PdbSourceFileProviderFactory(string symbolSearchPath, ILogger logger) - : base() - { - this._logger = logger; - this._symbolSearchPath = symbolSearchPath; - } - - #region ISourceFileProviderFactory - public ISourceFileProvider CreateProvider() - { - return new PdbSourceFileProvider(this._symbolSearchPath, this._logger); - } - #endregion // ISourceFileProviderFactory - - #region Nested classes - /// - /// Helper class to encapsulate the symbol reader during analysis - /// of a type. This class is instantiated when the base class asks - /// for a location context, and then it is disposed by the base. - /// - internal class PdbSourceFileProvider : ISourceFileProvider, IDisposable - { - private readonly ILogger _logger; - private readonly string _symbolSearchPath; - private readonly Dictionary _symbolReadersByType = new Dictionary(); - - internal PdbSourceFileProvider(string symbolSearchPath, ILogger logger) - { - this._symbolSearchPath = symbolSearchPath; - this._logger = logger; - } - - /// - /// Indexer that gets the appropriate to analyze - /// the specified . This indexer caches by Assembly. - /// - /// The type we will analyze. - /// A or null if one is not available. - internal ISymbolReader this[Type type] - { - get - { - Debug.Assert(type != null, "The type is required"); - Assembly assembly = type.Assembly; - ISymbolReader reader = null; - - // Lazily create the readers for assemblies we have not yet encountered. - if (!this._symbolReadersByType.TryGetValue(assembly, out reader)) - { - // We don't create symbol readers for System assemblies - if (!assembly.IsSystemAssembly()) - { - // Lazy create. Note that a null is a legal result and will - // be cached to avoid redundant failures - reader = this.CreateSymbolReader(assembly); - } - - this._symbolReadersByType[assembly] = reader; - } - - return reader; - } - } - - /// - /// Returns the name of the file for the given method using the given symbol reader - /// - /// The reader to use - /// The method to lookup - /// The file containing the method or null. - private static string GetFileForMethod(ISymbolReader reader, MethodBase methodBase) - { - int token = methodBase.MetadataToken; - - ISymbolMethod methodSymbol = reader == null ? null : reader.GetMethod(new SymbolToken(token)); - if (methodSymbol != null) - { - int count = methodSymbol.SequencePointCount; - if (count == 0) - return null; - - // Get the sequence points from the symbol store. - // We could cache these arrays and reuse them. - int[] offsets = new int[count]; - ISymbolDocument[] docs = new ISymbolDocument[count]; - int[] startColumn = new int[count]; - int[] endColumn = new int[count]; - int[] startRow = new int[count]; - int[] endRow = new int[count]; - methodSymbol.GetSequencePoints(offsets, docs, startRow, startColumn, endRow, endColumn); - - return docs[0].URL.ToString(); - } - return null; - } - - /// - /// Creates a for the given . - /// - /// The assembly whose reader is needed. - /// The instance or null if one cannot be created (e.g. no PDB). - private ISymbolReader CreateSymbolReader(Assembly assembly) - { - Debug.Assert(assembly != null, "The assembly is required"); - ISymbolReader reader = null; - string assemblyFile = assembly.Location; - - try - { - reader = SymbolAccess.GetReaderForFile(assemblyFile, this._symbolSearchPath); - } - catch (System.Runtime.InteropServices.COMException cex) - { - // Experience has shown some large PDB's can exhaust memory and cause COM failures. - // When this occurs, we log a warning and continue as if the PDB was not there. - if (this._logger != null) - { - this._logger.LogWarning(string.Format(CultureInfo.CurrentCulture, Resource.Failed_To_Open_PDB, assemblyFile, cex.Message)); - } - } - - return reader; - } - - #region IDisposable members - public void Dispose() - { - foreach (ISymbolReader reader in this._symbolReadersByType.Values) - { - IDisposable disposable = reader as IDisposable; - if (disposable != null) - { - disposable.Dispose(); - } - } - this._symbolReadersByType.Clear(); - } - #endregion // IDisposable member - - public string GetFileForMember(MemberInfo memberInfo) - { - string fileName = null; - - Type declaringType = memberInfo.DeclaringType; - - // Note: we allow checking for members declared anywhere in the hierarchy - // and so must open a PDB for the assembly containing the declaring type. - ISymbolReader reader = this[declaringType]; - - // Failure to find PDB short-circuits all lookups - if (reader != null) - { - // PDB knows only about methods, so this is the only one we really care about - MethodBase methodBase = memberInfo as MethodBase; - if (methodBase != null) - { - fileName = PdbSourceFileProvider.GetFileForMethod(reader, methodBase); - } - else - { - // Asking about a property decomposes into asking about the setter or getter - // method. - PropertyInfo propertyInfo = memberInfo as PropertyInfo; - if (propertyInfo != null) - { - methodBase = propertyInfo.GetGetMethod() ?? propertyInfo.GetSetMethod(); - if (methodBase != null) - { - fileName = this.GetFileForMember(methodBase); - } - } - } - } - return fileName; - } - } - #endregion // Nested classes - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/ReadMe.txt b/src/OpenRiaServices.Tools/Framework/Pdb/ReadMe.txt deleted file mode 100644 index 3bf5ea307..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/ReadMe.txt +++ /dev/null @@ -1,15 +0,0 @@ -This PDB folder contains a subset of code taken from Mike Stall's PDB-->XML sample. - -The latest sample is found at: - Dev10\pu\clr\qa\clr\testsrc\CoreCLRSDK\devsvcs\tests\tools\pdb2xml - -This sample required other "core" sample code from: - Dev10\pu\clr\qa\clr\testsrc\CoreCLRSDK\devsvcs\tests\tools\mdbg\mdbgsource\coreapi\SymStore - -The following changes were made to the code: - 1) Made FxCop and StyleCop clean - 2) Removed all unnecessary code for PDB writers - 3) Removed ILDB support - 4) Modified the namespace to live in OpenRiaServices.Tools.Pdb and Pdb.SymStore - 5) Made all types internal rather than public - \ No newline at end of file diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/HResults.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/HResults.cs deleted file mode 100644 index 89199e9c4..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/HResults.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - internal enum HResult - { - /// - /// General failure - /// - E_FAIL = unchecked((int)0x80004005), - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymBinder2.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymBinder2.cs deleted file mode 100644 index 415b1d0f4..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymBinder2.cs +++ /dev/null @@ -1,23 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Runtime.InteropServices.ComTypes; - - [ComVisible(false)] - internal interface ISymbolBinder2 - { - ISymbolReader GetReaderForFile(Object importer, String filename, String searchPath); - - ISymbolReader GetReaderForFile(Object importer, String fileName, - String searchPath, SymSearchPolicies searchPolicy); - - ISymbolReader GetReaderForFile(Object importer, String fileName, - String searchPath, SymSearchPolicies searchPolicy, - object callback); - - ISymbolReader GetReaderFromStream(Object importer, IStream stream); - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymConstant.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymConstant.cs deleted file mode 100644 index 6eded240f..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymConstant.cs +++ /dev/null @@ -1,18 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Runtime.InteropServices; - - // Interface does not need to be marked with the serializable attribute - // Interface is returned by ISymbolScope2.GetConstants() so must be public - [ComVisible(false)] - internal interface ISymbolConstant - { - String GetName(); - - Object GetValue(); - - byte[] GetSignature(); - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymENCUpdate.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymENCUpdate.cs deleted file mode 100644 index c9ee580be..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymENCUpdate.cs +++ /dev/null @@ -1,31 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Runtime.InteropServices.ComTypes; - - //// - [StructLayout(LayoutKind.Sequential)] - internal struct SymbolLineDelta - { - SymbolToken mdMethod; - int delta; - } - - //// - [ComVisible(false)] - internal interface ISymbolEncUpdate - { - //// - - void UpdateSymbolStore(IStream stream, SymbolLineDelta[] symbolLineDeltas); - //// - - int GetLocalVariableCount(SymbolToken mdMethodToken); - //// - - ISymbolVariable[] GetLocalVariables(SymbolToken mdMethodToken); - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymEncMethod.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymEncMethod.cs deleted file mode 100644 index 58f7b50e2..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymEncMethod.cs +++ /dev/null @@ -1,23 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - - // This interface isn't directly returned or used by any of the classes, - // but the implementation of the ISymbolMethod also implements ISymEncMethod - // so you could explicitly cast it to that. - [ComVisible(false)] - internal interface ISymbolEnCMethod : ISymbolMethod - { - String GetFileNameFromOffset(int dwOffset); - - int GetLineFromOffset(int dwOffset, - out int column, - out int endLine, - out int endColumn, - out int startOffset); - } -} - diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymReader2.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymReader2.cs deleted file mode 100644 index 281207d45..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymReader2.cs +++ /dev/null @@ -1,71 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Runtime.InteropServices.ComTypes; - - [ComVisible(false)] - internal interface ISymbolReader2 : ISymbolReader, IDisposable - { - // Initialize the symbol reader with the metadata importer interface - // that this reader will be associated with, along with the filename - // of the module. This can only be called once, and must be called - // before any other reader methods are called. - // - // Note: you need only specify one of the filename or the stream, - // not both. The searchPath parameter is optional. - void Initialize(Object importer, String filename, - String searchPath, IStream stream); - - // Update the existing symbol reader with a delta symbol store. This - // is used in EnC scenarios as a way to update the symbol store to - // match deltas to the original PE file. - // - // Only one of the filename or stream parameters need be specified. - // If a filename is specified, the symbol store will be updated with - // the symbols in that file. If a IStream is specified, the store will - // be updated with the data from the IStream. - void UpdateSymbolStore(String fileName, IStream stream); - - // Update the existing symbol reader with a delta symbol - // store. This is much like UpdateSymbolStore, but the given detla - // acts as a complete replacement rather than an update. - // - // Only one of the filename or stream parameters need be specified. - // If a filename is specified, the symbol store will be updated with - // the symbols in that file. If a IStream is specified, the store will - // be updated with the data from the IStream. - void ReplaceSymbolStore(String fileName, IStream stream); - - // Provides the on disk filename of the symbol store. - String GetSymbolStoreFileName(); - - // Given a position in a document, return the ISymUnmanagedMethods that - // contains that position. - ISymbolMethod[] GetMethodsFromDocumentPosition( - ISymbolDocument document, int line, int column); - - // The document version starts at 1 and is incremented each time - // the document is updated via UpdateSymbols. - // bCurrent is true is this is the latest version of the document. - int GetDocumentVersion(ISymbolDocument document, - out Boolean isCurrent); - - // The method version starts at 1 and is incremented each time - // the method is recompiled. (This can happen changes to the method.) - int GetMethodVersion(ISymbolMethod method); - } - - // This interface is implemented by the internal SymReader - // so it could be converted to this and have it's methods called. - [ComVisible(false)] - internal interface ISymbolReaderSymbolSearchInfo - { - int GetSymbolSearchInfoCount(); - - ISymbolSearchInfo[] GetSymbolSearchInfo(); - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymScope2.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymScope2.cs deleted file mode 100644 index bb74c8fea..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymScope2.cs +++ /dev/null @@ -1,19 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - - // This interface isn't directly returned, but SymbolScope which implements ISymbolScope - // also implements ISymbolScope2 and thus you may want to explicitly cast it to use these methods. - [ComVisible(false)] - internal interface ISymbolScope2 : ISymbolScope - { - int LocalCount{ get; } - - int ConstantCount{ get; } - - ISymbolConstant[] GetConstants(); - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymSearchInfo.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymSearchInfo.cs deleted file mode 100644 index c67f5ef1b..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/ISymSearchInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System; - using System.Runtime.InteropServices; - - // This interface is returned by ISymbolReaderSymbolSearchInfo - // and thus must be public - [ComVisible(false)] - internal interface ISymbolSearchInfo - { - int SearchPathLength { get; } - - String SearchPath { get; } - - int HResult { get; } - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymAccess.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymAccess.cs deleted file mode 100644 index 6afff3550..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymAccess.cs +++ /dev/null @@ -1,148 +0,0 @@ -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - - /// - /// Enumeration of supported symbol formats - /// - internal enum SymbolFormat - { - /// - /// Normal PDB format - requires diasymreader.dll - /// - PDB - } - - /// - /// This class includes methods for getting top-level access to symbol objects for reading and writing to PDB files - /// - internal static class SymbolAccess - { - const int OPEN_READ = 0; - const int OPEN_WRITE = 1; - - // Guids for imported metadata interfaces. - private static Guid dispenserClassID = new Guid(0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x00, 0x80, 0xc7, 0x92, 0xe5, 0xd8); // CLSID_CorMetaDataDispenser - private static Guid dispenserIID = new Guid(0x809c652e, 0x7396, 0x11d2, 0x97, 0x71, 0x00, 0xa0, 0xc9, 0xb4, 0xd5, 0x0c); // IID_IMetaDataDispenser - private static Guid importerIID = new Guid(0x7dac8207, 0xd3ae, 0x4c75, 0x9b, 0x67, 0x92, 0x80, 0x1a, 0x49, 0x7d, 0x44); // IID_IMetaDataImport - - internal static class NativeMethods - { - [DllImport("ole32.dll")] - internal static extern int CoCreateInstance([In] ref Guid rclsid, - [In, MarshalAs(UnmanagedType.IUnknown)] Object pUnkOuter, - [In] uint dwClsContext, - [In] ref Guid riid, - [Out, MarshalAs(UnmanagedType.Interface)] out Object ppv); - } - - /// - /// If you want a SymbolReader for a given exe, just use this function. - /// - /// The path to the file - /// A symbol reader - internal static ISymbolReader GetReaderForFile(string pathModule) - { - return GetReaderForFile(pathModule, null); - } - - /// - /// If you know the name of the exe and a searchPath where the file may exist, use this one. - /// - /// The module name to search - /// The search path if known. It may be null. - /// A new symbol reader for that module - internal static ISymbolReader GetReaderForFile(string pathModule, string searchPath) - { - return GetReaderForFile(SymbolFormat.PDB, pathModule, searchPath); - } - - /* - * Implementation which allows customization of the SymbolBinder to use. - * searchPath is a semicolon-delimited list of paths on which to search for pathModule. - * If searchPath is null, pathModule must be a full path to the assembly. - */ - internal static ISymbolReader GetReaderForFile(SymbolFormat symFormat, string pathModule, string searchPath) - { - // Create the appropriate symbol binder - SymbolBinder binder; - if (symFormat == SymbolFormat.PDB) - { - binder = new SymbolBinder(); - } - else - { - throw new ArgumentException("Invalid format", nameof(symFormat)); - } - - // Create the Metadata dispenser. - object objDispenser; - NativeMethods.CoCreateInstance(ref dispenserClassID, null, 1, ref dispenserIID, out objDispenser); - - // Now open an Importer on the given filename. We'll end up passing this importer straight - // through to the Binder. - object objImporter; - IMetaDataDispenserPrivate dispenser = (IMetaDataDispenserPrivate)objDispenser; - dispenser.OpenScope(pathModule, OPEN_READ, ref importerIID, out objImporter); - - IntPtr importerPtr = IntPtr.Zero; - ISymbolReader reader; - try - { - // This will manually AddRef the underlying object, so we need to be very careful to Release it. - importerPtr = Marshal.GetComInterfaceForObject(objImporter, typeof(IMetadataImportPrivateComVisible)); - - reader = binder.GetReader(importerPtr, pathModule, searchPath); - } - finally - { - if (importerPtr != IntPtr.Zero) - { - Marshal.Release(importerPtr); - } - } - return reader; - } - } - - // We can use reflection-only load context to use reflection to query for metadata information rather - // than painfully import the com-classic metadata interfaces. - [Guid("809c652e-7396-11d2-9771-00a0c9b4d50c"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComVisible(true)] - internal interface IMetaDataDispenserPrivate - { - // We need to be able to call OpenScope, which is the 2nd vtable slot. - // Thus we need this one placeholder here to occupy the first slot.. - void DefineScope_Placeholder(); - - //STDMETHOD(OpenScope)( // Return code. - // LPCWSTR szScope, // [in] The scope to open. - // DWORD dwOpenFlags, // [in] Open mode flags. - // REFIID riid, // [in] The interface desired. - // IUnknown **ppIUnk) PURE; // [out] Return interface on success. - void OpenScope([In, MarshalAs(UnmanagedType.LPWStr)] String szScope, [In] Int32 dwOpenFlags, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.IUnknown)] out Object punk); - - // There are more methods in this interface, but we don't need them. - } - //// Since we're just blindly passing this interface through managed code to the Symbinder, we don't care about actually - //// importing the specific methods. - //// This needs to be public so that we can call Marshal.GetComInterfaceForObject() on it to get the - //// underlying metadata pointer. - //// That doesn't mean that you should actually use it though because the interface is basically empty. - - /// - /// This interface is public to allow Marshal.GetComInterfaceForObject() within this - /// implementation. Do not use this interface. - /// - [Guid("7DAC8207-D3AE-4c75-9B67-92801A497D44"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - [ComVisible(true)] - public interface IMetadataImportPrivateComVisible - { - /// - /// Just need a single placeholder method so that it doesn't complain about an empty interface. - /// - void Placeholder(); - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymConstant.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymConstant.cs deleted file mode 100644 index 1e6e856de..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymConstant.cs +++ /dev/null @@ -1,68 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - - - // Interface does not need to be marked with the serializable attribute - using System; - using System.Runtime.InteropServices; - using System.Text; - - [ - ComImport, - Guid("48B25ED8-5BAD-41bc-9CEE-CD62FABC74E9"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedConstant - { - void GetName(int cchName, - out int pcchName, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder name); - - void GetValue(out Object pValue); - - void GetSignature(int cSig, - out int pcSig, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] byte[] sig); - } - - internal class SymConstant : ISymbolConstant - { - readonly ISymUnmanagedConstant m_target; - - public SymConstant(ISymUnmanagedConstant target) - { - // We should not wrap null instances - if (target == null) - throw new ArgumentNullException(nameof(target)); - - m_target = target; - } - - public String GetName() - { - int count; - m_target.GetName(0, out count, null); - StringBuilder name = new StringBuilder(count); - m_target.GetName(count, out count, name); - return name.ToString(); - } - - public Object GetValue() - { - Object value = null; - m_target.GetValue(out value); - return value; - } - - public byte[] GetSignature() - { - int count = 0; - m_target.GetSignature(0, out count, null); - byte[] sig = new byte[count]; - m_target.GetSignature(count, out count, sig); - return sig; - } - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymDocument.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymDocument.cs deleted file mode 100644 index c25ee5010..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymDocument.cs +++ /dev/null @@ -1,187 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Text; - - [ - ComImport, - Guid("40DE4037-7C81-3E1E-B022-AE1ABFF2CA08"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedDocument - { - void GetURL(int cchUrl, - out int pcchUrl, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder szUrl); - - void GetDocumentType(ref Guid pRetVal); - - void GetLanguage(ref Guid pRetVal); - - void GetLanguageVendor(ref Guid pRetVal); - - void GetCheckSumAlgorithmId(ref Guid pRetVal); - - void GetCheckSum(int cData, - out int pcData, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] byte[] data); - - void FindClosestLine(int line, - out int pRetVal); - - void HasEmbeddedSource(out Boolean pRetVal); - - void GetSourceLength(out int pRetVal); - - void GetSourceRange(int startLine, - int startColumn, - int endLine, - int endColumn, - int cSourceBytes, - out int pcSourceBytes, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=4)] byte[] source); - - }; - - //// - internal class SymbolDocument : ISymbolDocument - { - readonly ISymUnmanagedDocument m_unmanagedDocument; - - internal SymbolDocument(ISymUnmanagedDocument document) - { - if (document == null) - { - throw new ArgumentNullException(nameof(document)); - } - m_unmanagedDocument = document; - } - - //// - public String URL - { - get - { - StringBuilder URL; - int cchUrl; - m_unmanagedDocument.GetURL(0, out cchUrl, null); - URL = new StringBuilder(cchUrl); - m_unmanagedDocument.GetURL(cchUrl, out cchUrl, URL); - return URL.ToString(); - } - } - - //// - public Guid DocumentType - { - get - { - Guid guid = new Guid(); - m_unmanagedDocument.GetDocumentType(ref guid); - return guid; - } - } - - //// - public Guid Language - { - get - { - Guid guid = new Guid(); - m_unmanagedDocument.GetLanguage(ref guid); - return guid; - } - } - - //// - public Guid LanguageVendor - { - get - { - Guid guid = new Guid(); - m_unmanagedDocument.GetLanguageVendor(ref guid); - return guid; - } - } - - //// - public Guid CheckSumAlgorithmId - { - get - { - Guid guid = new Guid(); - m_unmanagedDocument.GetCheckSumAlgorithmId(ref guid); - return guid; - } - } - - //// - public byte[] GetCheckSum() - { - byte[] Data; - int cData = 0; - m_unmanagedDocument.GetCheckSum(0, out cData, null); - Data = new byte[cData]; - m_unmanagedDocument.GetCheckSum(cData, out cData, Data); - return Data; - } - - - //// - public int FindClosestLine(int line) - { - int closestLine = 0; - m_unmanagedDocument.FindClosestLine(line, out closestLine); - return closestLine; - } - - //// - public bool HasEmbeddedSource - { - get - { - bool retVal = false; - m_unmanagedDocument.HasEmbeddedSource(out retVal); - return retVal; - } - } - - //// - public int SourceLength - { - get - { - int retVal = 0; - m_unmanagedDocument.GetSourceLength(out retVal); - return retVal; - } - } - - - - //// - public byte[] GetSourceRange(int startLine, int startColumn, - int endLine, int endColumn) - { - byte[] Data; - int count = 0; - m_unmanagedDocument.GetSourceRange(startLine, startColumn, endLine, endColumn, 0, out count, null); - Data = new byte[count]; - m_unmanagedDocument.GetSourceRange(startLine, startColumn, endLine, endColumn, count, out count, Data); - return Data; - } - - internal ISymUnmanagedDocument InternalDocument - { - get - { - return m_unmanagedDocument; - } - } - - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymNamespace.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymNamespace.cs deleted file mode 100644 index 44a608ed4..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymNamespace.cs +++ /dev/null @@ -1,92 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Text; - - // Interface does not need to be marked with the serializable attribute - //// - [ - ComImport, - Guid("0DFF7289-54F8-11d3-BD28-0000F80849BD"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedNamespace - { - void GetName(int cchName, - out int pcchName, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName); - - void GetNamespaces(int cNameSpaces, - out int pcNameSpaces, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedNamespace[] namespaces); - - void GetVariables(int cVars, - out int pcVars, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedVariable[] pVars); - } - - - - internal class SymNamespace : ISymbolNamespace - { - readonly ISymUnmanagedNamespace m_unmanagedNamespace; - - internal SymNamespace(ISymUnmanagedNamespace nameSpace) - { - // We should not wrap null instances - if (nameSpace == null) - throw new ArgumentNullException(nameof(nameSpace)); - - m_unmanagedNamespace = nameSpace; - } - - public String Name - { - get - { - StringBuilder Name; - int cchName = 0; - m_unmanagedNamespace.GetName(0, out cchName, null); - Name = new StringBuilder(cchName); - m_unmanagedNamespace.GetName(cchName, out cchName, Name); - return Name.ToString(); - } - } - - public ISymbolNamespace[] GetNamespaces() - { - uint i; - int cNamespaces = 0; - m_unmanagedNamespace.GetNamespaces(0, out cNamespaces, null); - ISymUnmanagedNamespace[] unmamagedNamespaces = new ISymUnmanagedNamespace[cNamespaces]; - m_unmanagedNamespace.GetNamespaces(cNamespaces, out cNamespaces, unmamagedNamespaces); - - ISymbolNamespace[] Namespaces = new ISymbolNamespace[cNamespaces]; - for (i = 0; i < cNamespaces; i++) - { - Namespaces[i] = new SymNamespace(unmamagedNamespaces[i]); - } - return Namespaces; - } - - public ISymbolVariable[] GetVariables() - { - int cVars = 0; - uint i; - m_unmanagedNamespace.GetVariables(0, out cVars, null); - ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[cVars]; - m_unmanagedNamespace.GetVariables(cVars, out cVars, unmanagedVariables); - - ISymbolVariable[] Variables = new ISymbolVariable[cVars]; - for (i = 0; i < cVars; i++) - { - Variables[i] = new SymVariable(unmanagedVariables[i]); - } - return Variables; - } - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymReader.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymReader.cs deleted file mode 100644 index b09d30f27..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymReader.cs +++ /dev/null @@ -1,468 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Runtime.InteropServices.ComTypes; - using System.Text; - - [ - ComImport, - Guid("B4CE6286-2A6B-3712-A3B7-1EE1DAD467B5"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedReader - { - void GetDocument([MarshalAs(UnmanagedType.LPWStr)] String url, - Guid language, - Guid languageVendor, - Guid documentType, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedDocument retVal); - - void GetDocuments(int cDocs, - out int pcDocs, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedDocument[] pDocs); - - - // These methods will often return error HRs in common cases. - // Using PreserveSig and manually handling error cases provides a big performance win. - // Far fewer exceptions will be thrown and caught. - // Exceptions should be reserved for truely "exceptional" cases. - [PreserveSig] - int GetUserEntryPoint(out SymbolToken EntryPoint); - - [PreserveSig] - int GetMethod(SymbolToken methodToken, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod retVal); - - [PreserveSig] - int GetMethodByVersion(SymbolToken methodToken, - int version, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod retVal); - - void GetVariables(SymbolToken parent, - int cVars, - out int pcVars, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ISymUnmanagedVariable[] vars); - - void GetGlobalVariables(int cVars, - out int pcVars, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedVariable[] vars); - - - void GetMethodFromDocumentPosition(ISymUnmanagedDocument document, - int line, - int column, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod retVal); - - void GetSymAttribute(SymbolToken parent, - [MarshalAs(UnmanagedType.LPWStr)] String name, - int sizeBuffer, - out int lengthBuffer, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)] byte[] buffer); - - void GetNamespaces(int cNameSpaces, - out int pcNameSpaces, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedNamespace[] namespaces); - - void Initialize(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String filename, - [MarshalAs(UnmanagedType.LPWStr)] String searchPath, - IStream stream); - - void UpdateSymbolStore([MarshalAs(UnmanagedType.LPWStr)] String filename, - IStream stream); - - void ReplaceSymbolStore([MarshalAs(UnmanagedType.LPWStr)] String filename, - IStream stream); - - void GetSymbolStoreFileName(int cchName, - out int pcchName, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName); - - void GetMethodsFromDocumentPosition(ISymUnmanagedDocument document, - int line, - int column, - int cMethod, - out int pcMethod, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=3)] ISymUnmanagedMethod[] pRetVal); - - void GetDocumentVersion(ISymUnmanagedDocument pDoc, - out int version, - out Boolean pbCurrent); - - void GetMethodVersion(ISymUnmanagedMethod pMethod, - out int version); - }; - - [ - ComImport, - Guid("E502D2DD-8671-4338-8F2A-FC08229628C4"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedEncUpdate - { - - void UpdateSymbolStore2(IStream stream, - [MarshalAs(UnmanagedType.LPArray)] SymbolLineDelta[] iSymbolLineDeltas, - int cDeltaLines); - - void GetLocalVariableCount(SymbolToken mdMethodToken, - out int pcLocals); - - void GetLocalVariables(SymbolToken mdMethodToken, - int cLocals, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)] ISymUnmanagedVariable[] rgLocals, - out int pceltFetched); - } - - - [ - ComImport, - Guid("20D9645D-03CD-4e34-9C11-9848A5B084F1"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedReaderSymbolSearchInfo - { - void GetSymbolSearchInfoCount(out int pcSearchInfo); - - void GetSymbolSearchInfo(int cSearchInfo, - out int pcSearchInfo, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedSymbolSearchInfo[] searchInfo); - } - - - [ - ComImport, - Guid("969708D2-05E5-4861-A3B0-96E473CDF63F"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedDispose - { - void Destroy(); - } - - - internal class SymReader : ISymbolReader, ISymbolReader2, ISymbolReaderSymbolSearchInfo, ISymbolEncUpdate, IDisposable - { - - private ISymUnmanagedReader m_reader; // Unmanaged Reader pointer - - internal SymReader(ISymUnmanagedReader reader) - { - // We should not wrap null instances - if (reader == null) - throw new ArgumentNullException(nameof(reader)); - - m_reader = reader; - } - - public void Dispose() - { - GC.SuppressFinalize(this); - - // If the underlying symbol reader supports an explicit dispose interface to release it's resources, - // then call it. - ISymUnmanagedDispose disposer = m_reader as ISymUnmanagedDispose; - if (disposer != null) - { - disposer.Destroy(); - } - - m_reader = null; - } - - public ISymbolDocument GetDocument(String url, - Guid language, - Guid languageVendor, - Guid documentType) - { - ISymUnmanagedDocument document = null; - m_reader.GetDocument(url, language, languageVendor, documentType, out document); - if (document == null) - { - return null; - } - return new SymbolDocument(document); - } - - public ISymbolDocument[] GetDocuments() - { - int cDocs = 0; - m_reader.GetDocuments(0, out cDocs, null); - ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[cDocs]; - m_reader.GetDocuments(cDocs, out cDocs, unmanagedDocuments); - - ISymbolDocument[] documents = new SymbolDocument[cDocs]; - uint i; - for (i = 0; i < cDocs; i++) - { - documents[i] = new SymbolDocument(unmanagedDocuments[i]); - } - return documents; - } - - public SymbolToken UserEntryPoint - { - get - { - SymbolToken entryPoint; - int hr = m_reader.GetUserEntryPoint(out entryPoint); - if (hr == (int)HResult.E_FAIL) - { - // Not all assemblies have entry points - // dlls for example... - return new SymbolToken(0); - } - else - { - Marshal.ThrowExceptionForHR(hr); - } - return entryPoint; - } - } - - public ISymbolMethod GetMethod(SymbolToken method) - { - ISymUnmanagedMethod unmanagedMethod = null; - int hr = m_reader.GetMethod(method, out unmanagedMethod); - if (hr == (int)HResult.E_FAIL) - { - // This means that the method has no symbol info because it's probably empty - // This can happen for virtual methods with no IL - return null; - } - else - { - Marshal.ThrowExceptionForHR(hr); - } - return new SymMethod(unmanagedMethod); - } - - public ISymbolMethod GetMethod(SymbolToken method, int version) - { - ISymUnmanagedMethod unmanagedMethod = null; - int hr = m_reader.GetMethodByVersion(method, version, out unmanagedMethod); - if (hr == (int)HResult.E_FAIL) - { - // This means that the method has no symbol info because it's probably empty - // This can happen for virtual methods with no IL - return null; - } - else - { - Marshal.ThrowExceptionForHR(hr); - } - return new SymMethod(unmanagedMethod); - } - - public ISymbolVariable[] GetVariables(SymbolToken parent) - { - int cVars = 0; - uint i; - m_reader.GetVariables(parent, 0, out cVars, null); - ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[cVars]; - m_reader.GetVariables(parent, cVars, out cVars, unmanagedVariables); - SymVariable[] variables = new SymVariable[cVars]; - - for (i = 0; i < cVars; i++) - { - variables[i] = new SymVariable(unmanagedVariables[i]); - } - return variables; - } - - public ISymbolVariable[] GetGlobalVariables() - { - int cVars = 0; - uint i; - m_reader.GetGlobalVariables(0, out cVars, null); - ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[cVars]; - m_reader.GetGlobalVariables(cVars, out cVars, unmanagedVariables); - SymVariable[] variables = new SymVariable[cVars]; - - for (i = 0; i < cVars; i++) - { - variables[i] = new SymVariable(unmanagedVariables[i]); - } - return variables; - } - - public ISymbolMethod GetMethodFromDocumentPosition(ISymbolDocument document, - int line, - int column) - { - ISymUnmanagedMethod unmanagedMethod = null; - m_reader.GetMethodFromDocumentPosition(((SymbolDocument)document).InternalDocument, line, column, out unmanagedMethod); - return new SymMethod(unmanagedMethod); - } - - public byte[] GetSymAttribute(SymbolToken parent, String name) - { - byte[] Data; - int cData = 0; - m_reader.GetSymAttribute(parent, name, 0, out cData, null); - if (cData == 0) - { - // no such attribute (can't distinguish from empty attribute value) - return null; - } - Data = new byte[cData]; - m_reader.GetSymAttribute(parent, name, cData, out cData, Data); - return Data; - } - - public ISymbolNamespace[] GetNamespaces() - { - int count = 0; - uint i; - m_reader.GetNamespaces(0, out count, null); - ISymUnmanagedNamespace[] unmanagedNamespaces = new ISymUnmanagedNamespace[count]; - m_reader.GetNamespaces(count, out count, unmanagedNamespaces); - ISymbolNamespace[] namespaces = new SymNamespace[count]; - - for (i = 0; i < count; i++) - { - namespaces[i] = new SymNamespace(unmanagedNamespaces[i]); - } - return namespaces; - } - - public void Initialize(Object importer, String filename, - String searchPath, IStream stream) - { - IntPtr uImporter = IntPtr.Zero; - try { - uImporter = Marshal.GetIUnknownForObject(importer); - m_reader.Initialize(uImporter, filename, searchPath, stream); - } finally { - if (uImporter != IntPtr.Zero) - Marshal.Release(uImporter); - } - } - - public void UpdateSymbolStore(String fileName, IStream stream) - { - m_reader.UpdateSymbolStore(fileName, stream); - } - - public void ReplaceSymbolStore(String fileName, IStream stream) - { - m_reader.ReplaceSymbolStore(fileName, stream); - } - - - public String GetSymbolStoreFileName() - { - StringBuilder fileName; - int count = 0; - - // there's a known issue in Diasymreader where we can't query the size of the pdb filename. - // So we'll just estimate large as a workaround. - // @todo - See VSWhidbey bug 321941. - //m_reader.GetSymbolStoreFileName(0, out count, null); - // - count = 300; - fileName = new StringBuilder(count); - m_reader.GetSymbolStoreFileName(count, out count, fileName); - return fileName.ToString(); - } - - public ISymbolMethod[] GetMethodsFromDocumentPosition( - ISymbolDocument document, int line, int column) - - { - ISymUnmanagedMethod[] unmanagedMethods; - ISymbolMethod[] methods; - int count = 0; - uint i; - m_reader.GetMethodsFromDocumentPosition(((SymbolDocument)document).InternalDocument, line, column, 0, out count, null); - unmanagedMethods = new ISymUnmanagedMethod[count]; - m_reader.GetMethodsFromDocumentPosition(((SymbolDocument)document).InternalDocument, line, column, count, out count, unmanagedMethods); - methods = new ISymbolMethod[count]; - - for (i = 0; i < count; i++) - { - methods[i] = new SymMethod(unmanagedMethods[i]); - } - return methods; - } - - public int GetDocumentVersion(ISymbolDocument document, - out Boolean isCurrent) - { - int version = 0; - m_reader.GetDocumentVersion(((SymbolDocument)document).InternalDocument, out version, out isCurrent); - return version; - } - - public int GetMethodVersion(ISymbolMethod method) - { - int version = 0; - m_reader.GetMethodVersion(((SymMethod)method).InternalMethod, out version); - return version; - } - - - public void UpdateSymbolStore(IStream stream, - SymbolLineDelta[] iSymbolLineDeltas) - { - ((ISymUnmanagedEncUpdate)m_reader).UpdateSymbolStore2(stream, iSymbolLineDeltas, iSymbolLineDeltas.Length); - } - - public int GetLocalVariableCount(SymbolToken mdMethodToken) - { - int count = 0; - ((ISymUnmanagedEncUpdate)m_reader).GetLocalVariableCount(mdMethodToken, out count); - return count; - } - - public ISymbolVariable[] GetLocalVariables(SymbolToken mdMethodToken) - { - int count = 0; - ((ISymUnmanagedEncUpdate)m_reader).GetLocalVariables(mdMethodToken, 0, null, out count); - ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[count]; - ((ISymUnmanagedEncUpdate)m_reader).GetLocalVariables(mdMethodToken, count, unmanagedVariables, out count); - - ISymbolVariable[] variables = new ISymbolVariable[count]; - uint i; - for (i = 0; i < count; i++) - { - variables[i] = new SymVariable(unmanagedVariables[i]); - } - return variables; - } - - - public int GetSymbolSearchInfoCount() - { - int count = 0; - ((ISymUnmanagedReaderSymbolSearchInfo)m_reader).GetSymbolSearchInfoCount(out count); - return count; - } - - public ISymbolSearchInfo[] GetSymbolSearchInfo() - { - int count = 0; - ((ISymUnmanagedReaderSymbolSearchInfo)m_reader).GetSymbolSearchInfo(0, out count, null); - ISymUnmanagedSymbolSearchInfo[] unmanagedSearchInfo = new ISymUnmanagedSymbolSearchInfo[count]; - ((ISymUnmanagedReaderSymbolSearchInfo)m_reader).GetSymbolSearchInfo(count, out count, unmanagedSearchInfo); - - ISymbolSearchInfo[] searchInfo = new ISymbolSearchInfo[count]; - - uint i; - for (i = 0; i < count; i++) - { - searchInfo[i] = new SymSymbolSearchInfo(unmanagedSearchInfo[i]); - } - return searchInfo; - - } - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymScope.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymScope.cs deleted file mode 100644 index b2d786649..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymScope.cs +++ /dev/null @@ -1,224 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - - [ - ComImport, - Guid("68005D0F-B8E0-3B01-84D5-A11A94154942"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedScope - { - void GetMethod([MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod pRetVal); - - void GetParent([MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedScope pRetVal); - - void GetChildren(int cChildren, - out int pcChildren, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedScope[] children); - - void GetStartOffset(out int pRetVal); - - void GetEndOffset(out int pRetVal); - - void GetLocalCount(out int pRetVal); - - void GetLocals(int cLocals, - out int pcLocals, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedVariable[] locals); - - void GetNamespaces(int cNameSpaces, - out int pcNameSpaces, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedNamespace[] namespaces); - }; - - [ - ComImport, - Guid("AE932FBA-3FD8-4dba-8232-30A2309B02DB"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedScope2 : ISymUnmanagedScope - { - // ISymUnmanagedScope methods (need to define the base interface methods also, per COM interop requirements) - new void GetMethod([MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod pRetVal); - - new void GetParent([MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedScope pRetVal); - - new void GetChildren(int cChildren, - out int pcChildren, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ISymUnmanagedScope[] children); - - new void GetStartOffset(out int pRetVal); - - new void GetEndOffset(out int pRetVal); - - new void GetLocalCount(out int pRetVal); - - new void GetLocals(int cLocals, - out int pcLocals, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ISymUnmanagedVariable[] locals); - - new void GetNamespaces(int cNameSpaces, - out int pcNameSpaces, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] ISymUnmanagedNamespace[] namespaces); - - // ISymUnmanagedScope2 methods - void GetConstantCount(out int pRetVal); - - void GetConstants(int cConstants, - out int pcConstants, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedConstant[] constants); - } - - - internal class SymScope : ISymbolScope, ISymbolScope2 - { - readonly ISymUnmanagedScope m_target; - - internal SymScope(ISymUnmanagedScope target) - { - // We should not wrap null instances - if (target == null) - throw new ArgumentNullException(nameof(target)); - - m_target = target; - } - - public ISymbolMethod Method - { - get - { - ISymUnmanagedMethod uMethod = null; - m_target.GetMethod(out uMethod); - if (uMethod == null) - return null; - return new SymMethod(uMethod); - } - } - - public ISymbolScope Parent - { - get - { - ISymUnmanagedScope uScope = null; - m_target.GetParent(out uScope); - if (uScope == null) - return null; - return new SymScope(uScope); - } - } - - public ISymbolScope[] GetChildren() - { - int count; - m_target.GetChildren(0, out count, null); - ISymUnmanagedScope[] uScopes = new ISymUnmanagedScope[count]; - m_target.GetChildren(count, out count, uScopes); - - int i; - ISymbolScope[] scopes = new ISymbolScope[count]; - for (i = 0; i < count; i++) - { - scopes[i] = new SymScope(uScopes[i]); - } - return scopes; - } - - public int StartOffset - { - get - { - int offset; - m_target.GetStartOffset(out offset); - return offset; - } - } - - - public int EndOffset - { - get - { - int offset; - m_target.GetEndOffset(out offset); - return offset; - } - } - - public ISymbolVariable[] GetLocals() - { - int count; - m_target.GetLocals(0, out count, null); - ISymUnmanagedVariable[] uVariables = new ISymUnmanagedVariable[count]; - m_target.GetLocals(count, out count, uVariables); - - int i; - ISymbolVariable[] variables = new ISymbolVariable[count]; - for (i = 0; i < count; i++) - { - variables[i] = new SymVariable(uVariables[i]); - } - return variables; - } - - public ISymbolNamespace[] GetNamespaces() - { - int count; - m_target.GetNamespaces(0, out count, null); - ISymUnmanagedNamespace[] uNamespaces = new ISymUnmanagedNamespace[count]; - m_target.GetNamespaces(count, out count, uNamespaces); - - int i; - ISymbolNamespace[] namespaces = new ISymbolNamespace[count]; - for (i = 0; i < count; i++) - { - namespaces[i] = new SymNamespace(uNamespaces[i]); - } - return namespaces; - } - - public int LocalCount - { - get - { - int count; - m_target.GetLocalCount(out count); - return count; - } - } - - public int ConstantCount - { - get - { - int count; - ((ISymUnmanagedScope2)m_target).GetConstantCount(out count); - return count; - } - } - - public ISymbolConstant[] GetConstants() - { - int count; - ((ISymUnmanagedScope2)m_target).GetConstants(0, out count, null); - ISymUnmanagedConstant[] uConstants = new ISymUnmanagedConstant[count]; - ((ISymUnmanagedScope2)m_target).GetConstants(count, out count, uConstants); - - int i; - ISymbolConstant[] Constants = new ISymbolConstant[count]; - for (i = 0; i < count; i++) - { - Constants[i] = new SymConstant(uConstants[i]); - } - return Constants; - } - - - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymSearchInfo.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymSearchInfo.cs deleted file mode 100644 index 70d953deb..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymSearchInfo.cs +++ /dev/null @@ -1,69 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - - // Interface does not need to be marked with the serializable attribute - using System; - using System.Runtime.InteropServices; - using System.Text; - - [ - ComImport, - Guid("F8B3534A-A46B-4980-B520-BEC4ACEABA8F"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedSymbolSearchInfo - { - void GetSearchPathLength(out int pcchPath); - - void GetSearchPath(int cchPath, - out int pcchPath, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder szPath); - - void GetHRESULT(out int hr); - } - - internal class SymSymbolSearchInfo : ISymbolSearchInfo - { - readonly ISymUnmanagedSymbolSearchInfo m_target; - - public SymSymbolSearchInfo(ISymUnmanagedSymbolSearchInfo target) - { - m_target = target; - } - - public int SearchPathLength - { - get - { - int length; - m_target.GetSearchPathLength(out length); - return length; - } - } - - public String SearchPath - { - get - { - int length; - m_target.GetSearchPath(0, out length, null); - StringBuilder path = new StringBuilder(length); - m_target.GetSearchPath(length, out length, path); - return path.ToString(); - } - } - - public int HResult - { - get - { - int hr; - m_target.GetHRESULT(out hr); - return hr; - } - } - } - -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymSearchPolicyAttributes.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymSearchPolicyAttributes.cs deleted file mode 100644 index ae93e3ce9..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/SymSearchPolicyAttributes.cs +++ /dev/null @@ -1,27 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - - // Only statics, does not need to be marked with the serializable attribute - using System; - - /// - /// Available search policies for symbols - /// - [Serializable(), FlagsAttribute()] - internal enum SymSearchPolicies - { - // query the registry for symbol search paths - AllowRegistryAccess = 1, - - // access a symbol server - AllowSymbolServerAccess = 2, - - // Look at the path specified in Debug Directory - AllowOriginalPathAccess = 4, - - // look for PDB in the place where the exe is. - AllowReferencePathAccess = 8, - - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symbinder.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symbinder.cs deleted file mode 100644 index 03a56f1c1..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symbinder.cs +++ /dev/null @@ -1,274 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Runtime.InteropServices.ComTypes; - - [ - ComImport, - Guid("AA544d42-28CB-11d3-bd22-0000f80849bd"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedBinder - { - // These methods will often return error HRs in common cases. - // If there are no symbols for the given target, a failing hr is returned. - // This is pretty common. - // - // Using PreserveSig and manually handling error cases provides a big performance win. - // Far fewer exceptions will be thrown and caught. - // Exceptions should be reserved for truly "exceptional" cases. - [PreserveSig] - int GetReaderForFile(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String filename, - [MarshalAs(UnmanagedType.LPWStr)] String SearchPath, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader retVal); - - [PreserveSig] - int GetReaderFromStream(IntPtr importer, - IStream stream, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader retVal); - } - - [ - ComImport, - Guid("ACCEE350-89AF-4ccb-8B40-1C2C4C6F9434"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedBinder2 : ISymUnmanagedBinder - { - // ISymUnmanagedBinder methods (need to define the base interface methods also, per COM interop requirements) - [PreserveSig] - new int GetReaderForFile(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String filename, - [MarshalAs(UnmanagedType.LPWStr)] String SearchPath, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader retVal); - - [PreserveSig] - new int GetReaderFromStream(IntPtr importer, - IStream stream, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader retVal); - - // ISymUnmanagedBinder2 methods - [PreserveSig] - int GetReaderForFile2(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String fileName, - [MarshalAs(UnmanagedType.LPWStr)] String searchPath, - int searchPolicy, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader pRetVal); - } - - [ - ComImport, - Guid("28AD3D43-B601-4d26-8A1B-25F9165AF9D7"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedBinder3 : ISymUnmanagedBinder2 - { - // ISymUnmanagedBinder methods (need to define the base interface methods also, per COM interop requirements) - [PreserveSig] - new int GetReaderForFile(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String filename, - [MarshalAs(UnmanagedType.LPWStr)] String SearchPath, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader retVal); - - [PreserveSig] - new int GetReaderFromStream(IntPtr importer, - IStream stream, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader retVal); - - // ISymUnmanagedBinder2 methods (need to define the base interface methods also, per COM interop requirements) - [PreserveSig] - new int GetReaderForFile2(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String fileName, - [MarshalAs(UnmanagedType.LPWStr)] String searchPath, - int searchPolicy, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader pRetVal); - - // ISymUnmanagedBinder3 methods - [PreserveSig] - int GetReaderFromCallback(IntPtr importer, - [MarshalAs(UnmanagedType.LPWStr)] String fileName, - [MarshalAs(UnmanagedType.LPWStr)] String searchPath, - int searchPolicy, - [MarshalAs(UnmanagedType.IUnknown)] object callback, - [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedReader pRetVal); - } - - //// - - internal class SymbolBinder: ISymbolBinder1, ISymbolBinder2 - { - readonly ISymUnmanagedBinder m_binder; - - protected static readonly Guid CLSID_CorSymBinder = new Guid("0A29FF9E-7F9C-4437-8B11-F424491E3931"); - - //// - public SymbolBinder() - { - Type binderType = Type.GetTypeFromCLSID(CLSID_CorSymBinder); - object comBinder = (ISymUnmanagedBinder)Activator.CreateInstance(binderType); - m_binder = (ISymUnmanagedBinder)comBinder; - } - - /// - /// Create a SymbolBinder given the underling COM object for ISymUnmanagedBinder - /// - /// - /// Note that this could be protected, but C# doesn't have a way to express "internal AND - /// protected", just "internal OR protected" - internal SymbolBinder(ISymUnmanagedBinder comBinderObject) - { - // We should not wrap null instances - if (comBinderObject == null) - throw new ArgumentNullException(nameof(comBinderObject)); - - m_binder = comBinderObject; - } - - //// - public ISymbolReader GetReader(IntPtr importer, String filename, - String searchPath) - { - ISymUnmanagedReader reader = null; - int hr = m_binder.GetReaderForFile(importer, filename, searchPath, out reader); - if (IsFailingResultNormal(hr)) - { - return null; - } - Marshal.ThrowExceptionForHR(hr); - return new SymReader(reader); - } - - //// - public ISymbolReader GetReaderForFile(Object importer, String filename, - String searchPath) - { - ISymUnmanagedReader reader = null; - IntPtr uImporter = IntPtr.Zero; - try - { - uImporter = Marshal.GetIUnknownForObject(importer); - int hr = m_binder.GetReaderForFile(uImporter, filename, searchPath, out reader); - if (IsFailingResultNormal(hr)) - { - return null; - } - Marshal.ThrowExceptionForHR(hr); - } - finally - { - if (uImporter != IntPtr.Zero) - Marshal.Release(uImporter); - } - return new SymReader(reader); - } - - //// - public ISymbolReader GetReaderForFile(Object importer, String fileName, - String searchPath, SymSearchPolicies searchPolicy) - { - ISymUnmanagedReader symReader = null; - IntPtr uImporter = IntPtr.Zero; - try - { - uImporter = Marshal.GetIUnknownForObject(importer); - int hr = ((ISymUnmanagedBinder2)m_binder).GetReaderForFile2(uImporter, fileName, searchPath, (int)searchPolicy, out symReader); - if (IsFailingResultNormal(hr)) - { - return null; - } - Marshal.ThrowExceptionForHR(hr); - } - finally - { - if (uImporter != IntPtr.Zero) - Marshal.Release(uImporter); - } - return new SymReader(symReader); - } - - //// - public ISymbolReader GetReaderForFile(Object importer, String fileName, - String searchPath, SymSearchPolicies searchPolicy, - object callback) - { - ISymUnmanagedReader reader = null; - IntPtr uImporter = IntPtr.Zero; - try - { - uImporter = Marshal.GetIUnknownForObject(importer); - int hr = ((ISymUnmanagedBinder3)m_binder).GetReaderFromCallback(uImporter, fileName, searchPath, (int)searchPolicy, callback, out reader); - if (IsFailingResultNormal(hr)) - { - return null; - } - Marshal.ThrowExceptionForHR(hr); - } - finally - { - if (uImporter != IntPtr.Zero) - Marshal.Release(uImporter); - } - return new SymReader(reader); - } - - //// - public ISymbolReader GetReaderFromStream(Object importer, IStream stream) - { - ISymUnmanagedReader reader = null; - IntPtr uImporter = IntPtr.Zero; - try - { - uImporter = Marshal.GetIUnknownForObject(importer); - int hr = ((ISymUnmanagedBinder2)m_binder).GetReaderFromStream(uImporter, stream, out reader); - if (IsFailingResultNormal(hr)) - { - return null; - } - Marshal.ThrowExceptionForHR(hr); - } - finally - { - if (uImporter != IntPtr.Zero) - Marshal.Release(uImporter); - } - return new SymReader(reader); - } - - /// - /// Get an ISymbolReader interface given a raw COM symbol reader object. - /// - /// A COM object implementing ISymUnmanagedReader - /// The ISybmolReader interface wrapping the provided COM object - /// This method is on SymbolBinder because it's conceptually similar to the - /// other methods for creating a reader. It does not, however, actually need to use the underlying - /// Binder, so it could be on SymReader instead (but we'd have to make it a public class instead of - /// internal). - public static ISymbolReader GetReaderFromCOM(Object reader) - { - return new SymReader((ISymUnmanagedReader)reader); - } - - private static bool IsFailingResultNormal(int hr) - { - // If a pdb is not found, that's a pretty common thing. - if (hr == unchecked((int)0x806D0005)) // E_PDB_NOT_FOUND - { - return true; - } - // Other fairly common things may happen here, but we don't want to hide - // this from the programmer. - // You may get 0x806D0014 if the pdb is there, but just old (mismatched) - // Or if you ask for the symbol information on something that's not an assembly. - // If that may happen for your application, wrap calls to GetReaderForFile in - // try-catch(COMException) blocks and use the error code in the COMException to report error. - return false; - } - } -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symmethod.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symmethod.cs deleted file mode 100644 index de204536a..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symmethod.cs +++ /dev/null @@ -1,297 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Text; - - [ - ComImport, - Guid("B62B923C-B500-3158-A543-24F307A8B7E1"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - - internal interface ISymUnmanagedMethod - { - void GetToken(out SymbolToken pToken); - void GetSequencePointCount(out int retVal); - void GetRootScope([MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedScope retVal); - void GetScopeFromOffset(int offset, [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedScope retVal); - void GetOffset(ISymUnmanagedDocument document, - int line, - int column, - out int retVal); - void GetRanges(ISymUnmanagedDocument document, - int line, - int column, - int cRanges, - out int pcRanges, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=3)] int[] ranges); - void GetParameters(int cParams, - out int pcParams, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedVariable[] parms); - void GetNamespace([MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedNamespace retVal); - void GetSourceStartEnd(ISymUnmanagedDocument[] docs, - [In, Out, MarshalAs(UnmanagedType.LPArray)] int[] lines, - [In, Out, MarshalAs(UnmanagedType.LPArray)] int[] columns, - out Boolean retVal); - void GetSequencePoints(int cPoints, - out int pcPoints, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] int[] offsets, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] ISymUnmanagedDocument[] documents, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] int[] lines, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] int[] columns, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] int[] endLines, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] int[] endColumns); - } - - [ - ComImport, - Guid("85E891DA-A631-4c76-ACA2-A44A39C46B8C"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymENCUnmanagedMethod - { - void GetFileNameFromOffset(int dwOffset, - int cchName, - out int pcchName, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder name); - - void GetLineFromOffset(int dwOffset, - out int pline, - out int pcolumn, - out int pendLine, - out int pendColumn, - out int pdwStartOffset); - } - - - internal class SymMethod : ISymbolMethod, ISymbolEnCMethod - { - readonly ISymUnmanagedMethod m_unmanagedMethod; - - public SymMethod(ISymUnmanagedMethod unmanagedMethod) - { - // We should not wrap null instances - if (unmanagedMethod == null) - throw new ArgumentNullException(nameof(unmanagedMethod)); - - m_unmanagedMethod = unmanagedMethod; - } - - public SymbolToken Token - { - get - { - SymbolToken token; - m_unmanagedMethod.GetToken(out token); - return token; - } - } - - public int SequencePointCount - { - get - { - int retval = 0; - m_unmanagedMethod.GetSequencePointCount(out retval); - return retval; - } - } - - public void GetSequencePoints(int[] offsets, - ISymbolDocument[] documents, - int[] lines, - int[] columns, - int[] endLines, - int[] endColumns) - { - int spCount = 0; - if (offsets != null) - spCount = offsets.Length; - else if (documents != null) - spCount = documents.Length; - else if (lines != null) - spCount = lines.Length; - else if (columns != null) - spCount = columns.Length; - else if (endLines != null) - spCount = endLines.Length; - else if (endColumns != null) - spCount = endColumns.Length; - - // Don't do anything if they're not really asking for anything. - if (spCount == 0) - return; - - // Make sure all arrays are the same length. - if ((offsets != null) && (spCount != offsets.Length)) - throw new ArgumentException(); - - if ((lines != null) && (spCount != lines.Length)) - throw new ArgumentException(); - - if ((columns != null) && (spCount != columns.Length)) - throw new ArgumentException(); - - if ((endLines != null) && (spCount != endLines.Length)) - throw new ArgumentException(); - - if ((endColumns != null) && (spCount != endColumns.Length)) - throw new ArgumentException(); - - ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[documents.Length]; - int cPoints = 0; - uint i; - m_unmanagedMethod.GetSequencePoints(documents.Length, out cPoints, - offsets, unmanagedDocuments, - lines, columns, - endLines, endColumns); - - // Create the SymbolDocument form the IntPtr's - for (i = 0; i < documents.Length; i++) - { - documents[i] = new SymbolDocument(unmanagedDocuments[i]); - } - - return; - - } - - public ISymbolScope RootScope - { - get - { - ISymUnmanagedScope retval = null; - m_unmanagedMethod.GetRootScope(out retval); - return new SymScope(retval); - } - } - - public ISymbolScope GetScope(int offset) - { - ISymUnmanagedScope retVal = null; - m_unmanagedMethod.GetScopeFromOffset(offset, out retVal); - return new SymScope(retVal); - } - - public int GetOffset(ISymbolDocument document, - int line, - int column) - { - int retVal = 0; - m_unmanagedMethod.GetOffset(((SymbolDocument)document).InternalDocument, line, column, out retVal); - return retVal; - } - - public int[] GetRanges(ISymbolDocument document, - int line, - int column) - { - int cRanges = 0; - m_unmanagedMethod.GetRanges(((SymbolDocument)document).InternalDocument, line, column, 0, out cRanges, null); - int[] Ranges = new int[cRanges]; - m_unmanagedMethod.GetRanges(((SymbolDocument)document).InternalDocument, line, column, cRanges, out cRanges, Ranges); - return Ranges; - } - - - public ISymbolVariable[] GetParameters() - { - int cVariables = 0; - uint i; - m_unmanagedMethod.GetParameters(0, out cVariables, null); - ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[cVariables]; - m_unmanagedMethod.GetParameters(cVariables, out cVariables, unmanagedVariables); - - ISymbolVariable[] Variables = new ISymbolVariable[cVariables]; - for (i = 0; i < cVariables; i++) - { - Variables[i] = new SymVariable(unmanagedVariables[i]); - } - - return Variables; - } - - public ISymbolNamespace GetNamespace() - { - ISymUnmanagedNamespace retVal = null; - m_unmanagedMethod.GetNamespace(out retVal); - return new SymNamespace(retVal); - } - - public bool GetSourceStartEnd(ISymbolDocument[] docs, - int[] lines, - int[] columns) - { - uint i; - bool pRetVal = false; - int spCount = 0; - if (docs != null) - spCount = docs.Length; - else if (lines != null) - spCount = lines.Length; - else if (columns != null) - spCount = columns.Length; - - // If we don't have at least 2 entries then return an error - if (spCount < 2) - throw new ArgumentException(); - - // Make sure all arrays are the same length. - if ((docs != null) && (spCount != docs.Length)) - throw new ArgumentException(); - - if ((lines != null) && (spCount != lines.Length)) - throw new ArgumentException(); - - if ((columns != null) && (spCount != columns.Length)) - throw new ArgumentException(); - - ISymUnmanagedDocument[] unmanagedDocuments = new ISymUnmanagedDocument[docs.Length]; - m_unmanagedMethod.GetSourceStartEnd(unmanagedDocuments, lines, columns, out pRetVal); - if (pRetVal) - { - for (i = 0; i < docs.Length;i++) - { - docs[i] = new SymbolDocument(unmanagedDocuments[i]); - } - } - return pRetVal; - - } - - public String GetFileNameFromOffset(int dwOffset) - { - int cchName = 0; - ((ISymENCUnmanagedMethod)m_unmanagedMethod).GetFileNameFromOffset(dwOffset, 0, out cchName, null); - StringBuilder Name = new StringBuilder(cchName); - ((ISymENCUnmanagedMethod)m_unmanagedMethod).GetFileNameFromOffset(dwOffset, cchName, out cchName, Name); - return Name.ToString(); - } - - public int GetLineFromOffset(int dwOffset, - out int pcolumn, - out int pendLine, - out int pendColumn, - out int pdwStartOffset) - { - int line = 0; - ((ISymENCUnmanagedMethod)m_unmanagedMethod).GetLineFromOffset( - dwOffset, out line, out pcolumn, out pendLine, out pendColumn, out pdwStartOffset); - return line; - } - - public ISymUnmanagedMethod InternalMethod - { - get - { - return m_unmanagedMethod; - } - } - } - -} diff --git a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symvariable.cs b/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symvariable.cs deleted file mode 100644 index bc1580f8f..000000000 --- a/src/OpenRiaServices.Tools/Framework/Pdb/SymStore/symvariable.cs +++ /dev/null @@ -1,149 +0,0 @@ -// These interfaces serve as an extension to the BCL's SymbolStore interfaces. -namespace OpenRiaServices.Tools.Pdb.SymStore -{ - // Interface does not need to be marked with the serializable attribute - using System; - using System.Diagnostics.SymbolStore; - using System.Runtime.InteropServices; - using System.Text; - - [ - ComImport, - Guid("9F60EEBE-2D9A-3F7C-BF58-80BC991C60BB"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown), - ComVisible(false) - ] - internal interface ISymUnmanagedVariable - { - void GetName(int cchName, - out int pcchName, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder szName); - - void GetAttributes(out int pRetVal); - - void GetSignature(int cSig, - out int pcSig, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] byte[] sig); - - void GetAddressKind(out int pRetVal); - - void GetAddressField1(out int pRetVal); - - void GetAddressField2(out int pRetVal); - - void GetAddressField3(out int pRetVal); - - void GetStartOffset(out int pRetVal); - - void GetEndOffset(out int pRetVal); - } - - //// - - internal class SymVariable : ISymbolVariable - { - readonly ISymUnmanagedVariable m_unmanagedVariable; - - internal SymVariable(ISymUnmanagedVariable variable) - { - // We should not wrap null instances - if (variable == null) - throw new ArgumentNullException(nameof(variable)); - - m_unmanagedVariable = variable; - } - - public String Name - { - get - { - StringBuilder Name; - int cchName; - m_unmanagedVariable.GetName(0, out cchName, null); - Name = new StringBuilder(cchName); - m_unmanagedVariable.GetName(cchName, out cchName, Name); - return Name.ToString(); - } - } - - public Object Attributes - { - get - { - int RetVal; - m_unmanagedVariable.GetAttributes(out RetVal); - return (object)RetVal; - } - } - - public byte[] GetSignature() - { - byte[] Data; - int cData; - m_unmanagedVariable.GetSignature(0, out cData, null); - Data = new byte[cData]; - m_unmanagedVariable.GetSignature(cData, out cData, Data); - return Data; - } - - public SymAddressKind AddressKind - { - get - { - int RetVal; - m_unmanagedVariable.GetAddressKind(out RetVal); - return (SymAddressKind)RetVal; - } - } - - public int AddressField1 - { - get - { - int RetVal; - m_unmanagedVariable.GetAddressField1(out RetVal); - return RetVal; - } - } - - public int AddressField2 - { - get - { - int RetVal; - m_unmanagedVariable.GetAddressField2(out RetVal); - return RetVal; - } - } - - public int AddressField3 - { - get - { - int RetVal; - m_unmanagedVariable.GetAddressField3(out RetVal); - return RetVal; - } - } - - public int StartOffset - { - get - { - int RetVal; - m_unmanagedVariable.GetStartOffset(out RetVal); - return RetVal; - } - } - - public int EndOffset - { - get - { - int RetVal; - m_unmanagedVariable.GetEndOffset(out RetVal); - return RetVal; - } - } - } -} diff --git a/src/OpenRiaServices.Tools/Framework/ProjectFileReader.cs b/src/OpenRiaServices.Tools/Framework/ProjectFileReader.cs index 07e5cded8..e377a6f57 100644 --- a/src/OpenRiaServices.Tools/Framework/ProjectFileReader.cs +++ b/src/OpenRiaServices.Tools/Framework/ProjectFileReader.cs @@ -1,15 +1,11 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Reflection; using System.Text; using Microsoft.Build.Evaluation; using Microsoft.Build.Exceptions; -using Microsoft.Build.Execution; -using Microsoft.Build.Framework; namespace OpenRiaServices.Tools { @@ -20,12 +16,8 @@ namespace OpenRiaServices.Tools internal class ProjectFileReader : IDisposable { private readonly ILogger _logger; - -#if NET40 private ProjectCollection _projectCollection = new ProjectCollection(); -#else - Dictionary _loadedProjects = new Dictionary(StringComparer.OrdinalIgnoreCase); -#endif + /// /// Creates a new instance. /// @@ -102,7 +94,6 @@ internal Project LoadProject(string projectPath) try { -#if NET40 project = this._projectCollection.LoadedProjects.Where(p => string.Equals(p.FullPath, projectPath, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (project == null) { @@ -125,16 +116,6 @@ internal Project LoadProject(string projectPath) project.ReevaluateIfNecessary(); } } -#else - project = null; - if (!this._loadedProjects.TryGetValue(projectPath, out project)) - { - Engine engine = new Engine(); - project = new Project(engine); - project.Load(projectPath); - this._loadedProjects[projectPath] = project; - } -#endif } catch (InvalidOperationException ioe) { @@ -161,11 +142,7 @@ internal string GetPropertyValue(string projectPath, string propertyName) Project project = this.LoadProject(projectPath); if (project != null) { -#if NET40 propertyValue = project.GetPropertyValue(propertyName); -#else - propertyValue = project.GetEvaluatedProperty(propertyName); -#endif } return propertyValue; } @@ -191,15 +168,8 @@ internal IEnumerable LoadProjectReferences(string projectPath) this._logger.LogMessage(string.Format(CultureInfo.CurrentCulture, Resource.Analyzing_Project_References, Path.GetFileName(projectPath))); -#if NET40 projects = project.GetItems("ProjectReference").Select(i => ConvertToFullPath(i.EvaluatedInclude, projectPath)); -#else - BuildItemGroup buildItemGroup = project.GetEvaluatedItemsByName("ProjectReference"); - if (buildItemGroup != null) - { - projects = buildItemGroup.OfType().Select(b => ConvertToFullPath(b.FinalItemSpec, projectPath)); - } -#endif + // Tell the user what project references we found if (projects.Any()) { @@ -232,16 +202,9 @@ internal IEnumerable LoadSourceFilesFromProject(string projectPath) // Tell the user. This helps us see when we use the cache and when we don't this._logger.LogMessage(string.Format(CultureInfo.CurrentCulture, Resource.Analyzing_Project_Files, Path.GetFileName(projectPath))); -#if NET40 sources = project.GetItems("Compile").Select(i => ConvertToFullPath(i.EvaluatedInclude, projectPath)) .ToArray(); -#else - BuildItemGroup buildItemGroup = project.GetEvaluatedItemsByName("Compile"); - if (buildItemGroup != null) - { - sources = buildItemGroup.OfType().Select(b => ConvertToFullPath(b.FinalItemSpec, projectPath)); - } -#endif + return sources; } @@ -256,9 +219,7 @@ public void Dispose() if (this._projectCollection != null) { -#if NET40 this._projectCollection.Dispose(); -#endif this._projectCollection = null; } } diff --git a/src/OpenRiaServices.Tools/Framework/SharedTypes/SharedCodeService.cs b/src/OpenRiaServices.Tools/Framework/SharedTypes/SharedCodeService.cs index 171a5b917..e58c55eff 100644 --- a/src/OpenRiaServices.Tools/Framework/SharedTypes/SharedCodeService.cs +++ b/src/OpenRiaServices.Tools/Framework/SharedTypes/SharedCodeService.cs @@ -32,18 +32,13 @@ internal SharedCodeService(SharedCodeServiceParameters parameters, ILoggingServi Debug.Assert(parameters.SharedSourceFiles != null, "sharedSourceFiles cannot be null"); Debug.Assert(parameters.ClientAssemblies != null, "clientAssemblies cannot be null"); - // Convert optional list of PDB paths to semicolon separated list - string symbolSearchPath = parameters.SymbolSearchPaths == null - ? null - : string.Join(";", parameters.SymbolSearchPaths); - // We create an aggregating source file location service that will check in this order: // 1. SourceInfoAttributes generated by Live Intellisense, then // 2. PDB info ISourceFileProviderFactory[] factories = new ISourceFileProviderFactory[] { new SourceInfoSourceFileProviderFactory(), - new PdbSourceFileProviderFactory(symbolSearchPath, loggingService) + new PdbSourceFileProviderFactory(parameters.SymbolSearchPaths, loggingService) }; this._locationService = new SourceFileLocationService(factories, this._filenameMap); diff --git a/src/OpenRiaServices.Tools/Framework/SourceLocation/PdbSourceFileProviderFactory.cs b/src/OpenRiaServices.Tools/Framework/SourceLocation/PdbSourceFileProviderFactory.cs new file mode 100644 index 000000000..46edcf9ad --- /dev/null +++ b/src/OpenRiaServices.Tools/Framework/SourceLocation/PdbSourceFileProviderFactory.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.SymbolStore; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Reflection; +using Mono.Cecil; +using Mono.Cecil.Cil; +using Mono.Cecil.Pdb; +using OpenRiaServices.Tools.SharedTypes; + +namespace OpenRiaServices.Tools.SourceLocation +{ + /// + /// PDB-based implementation of to locate source files for types or methods. + /// + internal class PdbSourceFileProviderFactory : ISourceFileProviderFactory + { + private readonly ILogger _logger; + private readonly string[] _symbolSearchPaths; + + /// + /// Creates a new instance. + /// + /// Optional list of paths to search for PDB files. + /// Optional logger to use to report errors or warnings. + public PdbSourceFileProviderFactory(string[] symbolSearchPaths, ILogger logger) + : base() + { + this._logger = logger; + this._symbolSearchPaths = symbolSearchPaths; + } + + + #region ISourceFileProviderFactory + public ISourceFileProvider CreateProvider() + { + return new CecilSourceFileProvider(this._symbolSearchPaths, this._logger); + } + #endregion // ISourceFileProviderFactory + + #region Nested classes + /// + /// Helper class to encapsulate the symbol reader during analysis + /// of a type. This class is instantiated when the base class asks + /// for a location context, and then it is disposed by the base. + /// + internal sealed class CecilSourceFileProvider : ISourceFileProvider + { + private readonly ILogger _logger; + private readonly Dictionary _assembliesByLocation = new(); + private readonly ISymbolReaderProvider _symbolReaderProvider; + + internal CecilSourceFileProvider(string[] symbolSearchPath, ILogger logger) + { + _symbolReaderProvider = new SymbolReaderProvider(symbolSearchPath); + this._logger = logger; + } + + /// + /// Indexer that gets the appropriate to analyze + /// the specified . + /// + /// The type we will analyze. + /// A or null if one is not available. + internal TypeDefinition this[Type type] + { + get + { + Debug.Assert(type != null, "The type is required"); + Assembly assembly = type.Assembly; + string location = assembly.Location; + + // Lazily create the readers for assemblies we have not yet encountered. + if (!this._assembliesByLocation.TryGetValue(location, out AssemblyDefinition assemblyDefinition)) + { + // We don't create symbol readers for System assemblies + if (!assembly.IsSystemAssembly()) + { + // Lazy create. Note that a null is a legal result and will + // be cached to avoid redundant failures + try + { + var parameters = new ReaderParameters + { + ReadSymbols = true, + ReadWrite = false, + SymbolReaderProvider = _symbolReaderProvider + }; + + assemblyDefinition = AssemblyDefinition.ReadAssembly(location, parameters); + } + catch (Exception ex) + { + // Log informational message but continue without symbols + _logger.LogMessage($"Failed to load metadata for {assembly.FullName}: {ex}"); + + // Cache null + assemblyDefinition = null; + } + } + + this._assembliesByLocation[location] = assemblyDefinition; + } + + return assemblyDefinition?.MainModule.GetType(type.Namespace, type.Name); + } + } + + /// + /// Returns the name of the file for the given method using the given symbol reader + /// + /// The type to search in + /// The method to lookup + /// The file containing the method or null. + private static string GetFileForMethod(TypeDefinition typeDefinition, MethodBase methodBase) + { + // Token is unique identifer per compilation (so cannot use old pdb) + int token = methodBase.MetadataToken; + + var method = typeDefinition.Methods.FirstOrDefault(md => md.MetadataToken.ToInt32() == token); + return method?.DebugInformation.SequencePoints.FirstOrDefault()?.Document.Url; + } + + + #region IDisposable members + void IDisposable.Dispose() + { + foreach (var assemblyDefinition in this._assembliesByLocation.Values) + { + assemblyDefinition?.Dispose(); + } + this._assembliesByLocation.Clear(); + } + #endregion // IDisposable member + + public string GetFileForMember(MemberInfo memberInfo) + { + string fileName = null; + + Type declaringType = memberInfo.DeclaringType; + + // Note: we allow checking for members declared anywhere in the hierarchy + // and so must open a PDB for the assembly containing the declaring type. + TypeDefinition typeDefinition = this[declaringType]; + + // Failure to find PDB short-circuits all lookups + if (typeDefinition != null) + { + // PDB knows only about methods, so this is the only one we really care about + MethodBase methodBase = memberInfo as MethodBase; + if (methodBase != null) + { + fileName = CecilSourceFileProvider.GetFileForMethod(typeDefinition, methodBase); + } + else + { + // Asking about a property decomposes into asking about the setter or getter + // method. + PropertyInfo propertyInfo = memberInfo as PropertyInfo; + if (propertyInfo != null) + { + methodBase = propertyInfo.GetGetMethod() ?? propertyInfo.GetSetMethod(); + if (methodBase != null) + { + fileName = this.GetFileForMember(methodBase); + } + } + } + } + return fileName; + } + } + #endregion // Nested classes + } + + /// + /// A symbol reader which supports looking for pdb files based on symbol search path on lookup failure + /// + internal sealed class SymbolReaderProvider : ISymbolReaderProvider + { + readonly PdbReaderProvider _pdbReaderProvider = new PdbReaderProvider(); + readonly string[] _symbolSearchPaths; + + public SymbolReaderProvider(string[] symbolSearchPaths) + { + // List will contain duplicates + _symbolSearchPaths = symbolSearchPaths?.Distinct().ToArray(); + } + + public Mono.Cecil.Cil.ISymbolReader GetSymbolReader(ModuleDefinition module, string fileName) + { + try + { + return _pdbReaderProvider.GetSymbolReader(module, fileName); + } + catch (FileNotFoundException) when (_symbolSearchPaths != null) + { + string fileNameOnly = Path.GetFileNameWithoutExtension(fileName) + ".pdb"; + foreach (var path in _symbolSearchPaths) + { + var possibleName = Path.Combine(path, fileNameOnly); + if (File.Exists(possibleName)) + return _pdbReaderProvider.GetSymbolReader(module, possibleName); + } + + throw; + } + } + + public Mono.Cecil.Cil.ISymbolReader GetSymbolReader(ModuleDefinition module, Stream symbolStream) + { + return _pdbReaderProvider.GetSymbolReader(module, symbolStream); + } + } +} diff --git a/src/OpenRiaServices.Tools/Framework/SourceInfo/SourceInfo.cs b/src/OpenRiaServices.Tools/Framework/SourceLocation/SourceInfo.cs similarity index 98% rename from src/OpenRiaServices.Tools/Framework/SourceInfo/SourceInfo.cs rename to src/OpenRiaServices.Tools/Framework/SourceLocation/SourceInfo.cs index 725fda650..3bad6a6e6 100644 --- a/src/OpenRiaServices.Tools/Framework/SourceInfo/SourceInfo.cs +++ b/src/OpenRiaServices.Tools/Framework/SourceLocation/SourceInfo.cs @@ -157,7 +157,7 @@ internal static SourceInfo GetSourceInfoFromAttributes(IEnumerable attri foreach (object attribute in attributes) { Type attributeType = attribute.GetType(); - if (((SourceInfo.sourceInfoAttributeType != null && attributeType == SourceInfo.sourceInfoAttributeType)) || + if ((SourceInfo.sourceInfoAttributeType != null && attributeType == SourceInfo.sourceInfoAttributeType) || attributeType.FullName.EndsWith(SourceInfo.SourceInfoAttributeTypeName, StringComparison.Ordinal)) { return SourceInfo.GetSourceInfoFromAttribute(attribute); diff --git a/src/OpenRiaServices.Tools/Framework/SourceInfo/SourceInfoSourceFileProviderFactory.cs b/src/OpenRiaServices.Tools/Framework/SourceLocation/SourceInfoSourceFileProviderFactory.cs similarity index 83% rename from src/OpenRiaServices.Tools/Framework/SourceInfo/SourceInfoSourceFileProviderFactory.cs rename to src/OpenRiaServices.Tools/Framework/SourceLocation/SourceInfoSourceFileProviderFactory.cs index 960263e39..f1a4aad60 100644 --- a/src/OpenRiaServices.Tools/Framework/SourceInfo/SourceInfoSourceFileProviderFactory.cs +++ b/src/OpenRiaServices.Tools/Framework/SourceLocation/SourceInfoSourceFileProviderFactory.cs @@ -15,7 +15,7 @@ /// Implementation of that returns /// an that analyzes PDBs. /// - internal class SourceInfoSourceFileProviderFactory : ISourceFileProviderFactory + internal sealed class SourceInfoSourceFileProviderFactory : ISourceFileProviderFactory { public ISourceFileProvider CreateProvider() { @@ -26,7 +26,7 @@ public ISourceFileProvider CreateProvider() /// Implementation of that relies on /// the SourceInfoAttribute attached to type members. /// - internal class SourceInfoSourceFileProvider : ISourceFileProvider, IDisposable + internal sealed class SourceInfoSourceFileProvider : ISourceFileProvider { #region ISourceFileProvider methods @@ -43,15 +43,14 @@ internal class SourceInfoSourceFileProvider : ISourceFileProvider, IDisposable public string GetFileForMember(MemberInfo memberInfo) { SourceInfo sourceInfo = SourceInfo.GetSourceInfoFromAttributes(((ICustomAttributeProvider)memberInfo).GetCustomAttributes(false)); - return (sourceInfo == null) ? null : sourceInfo.FileName; + return sourceInfo?.FileName; } #endregion // ISourceFileProvider methods - #region IDisposable methods - public void Dispose() + void IDisposable.Dispose() { + // Nothing to dispose } - #endregion IDisposable methods } } } diff --git a/NuGet/OpenRiaServices.Client.CodeGen/build/OpenRiaServices.CodeGen.targets b/src/OpenRiaServices.Tools/Framework/build/OpenRiaServices.Client.CodeGen.targets similarity index 97% rename from NuGet/OpenRiaServices.Client.CodeGen/build/OpenRiaServices.CodeGen.targets rename to src/OpenRiaServices.Tools/Framework/build/OpenRiaServices.Client.CodeGen.targets index ff8f3c0e2..2dbae9b8c 100644 --- a/NuGet/OpenRiaServices.Client.CodeGen/build/OpenRiaServices.CodeGen.targets +++ b/src/OpenRiaServices.Tools/Framework/build/OpenRiaServices.Client.CodeGen.targets @@ -11,22 +11,24 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - - - - - - + <_OpenRiaTaskFramework>net472 + + $(SilverlightApplication) true Link <_OpenRiaDesignTimeBuild Condition="'$(DesignTimeBuild)' == 'true' OR '$(BuildingProject)' != 'true'">true - + + + + + + TRACE - pdbonly + portable true diff --git a/src/Test/WebsiteFullTrust/Web.config b/src/Test/WebsiteFullTrust/Web.config index 262311140..518593912 100644 --- a/src/Test/WebsiteFullTrust/Web.config +++ b/src/Test/WebsiteFullTrust/Web.config @@ -72,50 +72,57 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + - + - diff --git a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj index c406f2e8e..004548103 100644 --- a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj +++ b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj @@ -144,10 +144,10 @@ 6.4.4 - 3.1.24 + 3.1.32 - 6.0.1 + 7.0.0 4.5.4 diff --git a/src/global.json b/src/global.json index 616ca211c..2458b5b63 100644 --- a/src/global.json +++ b/src/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.200", + "version": "7.0.200", "rollForward": "major" } } \ No newline at end of file