New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paket shows parsing errors while doing BindingRedirects - #2408 #2952

Merged
merged 1 commit into from Dec 31, 2017
Jump to file or symbol
Failed to load files and symbols.
+102 −1
Diff settings

Always

Just for now

@@ -78,6 +78,14 @@ let ``#1195 should report broken app.config``() =
failwith "paket should fail"
with
| exn when exn.Message.Contains("Project1") && exn.Message.Contains("app.config") -> ()
[<Test>]
let ``#2408 should report wrong app.config parsing``() =
try
paket "install --redirects" "i002408-indenting-appconfig" |> ignore
failwith "paket should fail"
with
| exn when exn.Message.Contains("Project1") && exn.Message.Contains("app.config") -> ()
[<Test>]
let ``#1218 install should replace paket's binding redirects with required only``() =
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>e789c72a-5cfd-436b-8ef1-61aa2852a89f</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Project1</RootNamespace>
<AssemblyName>Project1</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
<Name>Project1</Name>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Debug\fsharp_project_scaffold_tests.XML</DocumentationFile>
<StartAction>Project</StartAction>
<StartProgram>
</StartProgram>
<StartArguments>
</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\Project1.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Project3\Project3.fsproj">
<Name>Project3</Name>
<Project>{3241afe4-afee-4465-a482-5abbc0bf6457}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-999.999.999.999" newVersion="3.3.0.0" />
</dependentAssembly>
</assemblyBinding></runtime></configuration>
@@ -0,0 +1,3 @@
source "http://nuget.org/api/v2"
nuget Castle.Core 3.3.3
@@ -158,7 +158,12 @@ let private applyBindingRedirects isFirstGroup cleanBindingRedirects (allKnownLi
|> List.iter (fun e -> e.Remove())
let config = Seq.fold setRedirect config bindingRedirects
indentAssemblyBindings config
try
indentAssemblyBindings config
with
| exn -> failwithf "Indenting binding redirects of %s failed.%s%s" configFilePath Environment.NewLine exn.Message
use newContents = new StringReader(config.ToString())
let newText = XDocument.Load(newContents, LoadOptions.None).ToString()
if newText <> original then
ProTip! Use n and p to navigate between commits in a pull request.