Skip to content
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 install with Silverlight project: This operation would create an incorrectly structured document. #1607

Closed
PapaMufflon opened this issue Apr 14, 2016 · 4 comments

Comments

@PapaMufflon
Copy link

Description

Even though I have redirects: off in my paket.dependencies, paket install tries to applyBindingRedirects for my Silverlight project. As we have a custom made app.config file with a custom root namespace, Linq.tryGetElement will return None for the <configuration /> element, because our custom root namespace is not considered. But I think this is just a follow-up error of the ignoring of the redirects: off switch.

Repro steps

Do paket install with attached solution SilverlightApplication4.zip --> This operation would create an incorrectly structured document.

Expected behavior

paket install runs successfully.

Actual behavior

paket install fails with This operation would create an incorrectly structured document.

Related information

  • Windows 7
  • Branch: main
  • .NET Runtime 4.5.2
@matthid
Copy link
Member

matthid commented Jul 9, 2017

Is this still happening?

@xt1
Copy link
Contributor

xt1 commented Jul 26, 2017

I'm getting this error when trying to convert a large workspace from Nuget to Paket.
I would love to know which file is causing the error, but it seems to be buried...

The last line of the log reads: Project (filepath.csproj) changed

Paket failed with
-> InvalidOperationException: This operation would create an incorrectly structured document.
StackTrace:
    at System.Xml.Linq.XDocument.ValidateDocument(XNode previous, XmlNodeType allowBefore, XmlNodeType allowAfter)
    at System.Xml.Linq.XContainer.AddNodeSkipNotify(XNode n)
    at [email protected](XContainer parent, String node)
    at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source)
    at Paket.BindingRedirects.setRedirect(XDocument doc, BindingRedirect bindingRedirect)
    at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source)
    at Paket.BindingRedirects.applyBindingRedirects(Boolean isFirstGroup, Boolean cleanBindingRedirects, IEnumerable`1 allKnownLibNames, IEnumerable`1 bindingRedirects, String configFilePath)
    at Paket.BindingRedirects.applyBindingRedirectsToFolder@182-1.Invoke(String configFilePath)
    at [email protected](ProjectFile projectFile)
    at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
    at Paket.InstallProcess.InstallIntoProjects[a](InstallerOptions options, Boolean forceTouch, DependenciesFile dependenciesFile, LockFile lockFile, FSharpList`1 projectsAndReferences, FSharpMap`2 updatedGroups)
    at Paket.UpdateProcess.SmartInstall(DependenciesFile dependenciesFile, UpdateMode updateMode, UpdaterOptions options)
    at <StartupCode$Paket-Core>[email protected](Unit unitVar0)
    at Paket.Utils.RunInLockedAccessMode[a](String rootFolder, FSharpFunc`2 action)
    at [email protected](ParseResults`1 results)
    at Paket.Program.processWithValidation[T](Boolean silent, FSharpFunc`2 validateF, FSharpFunc`2 commandF, ParseResults`1 result)
    at Paket.Program.main$cont@709(ParseResults`1 results, Boolean silent, Boolean fromBootstrapper, Unit unitVar)
    at Paket.Program.main()

@xt1
Copy link
Contributor

xt1 commented Jul 27, 2017

Any namespace on the root element triggers this error. Am working on a PR for this.

@llehn
Copy link
Contributor

llehn commented Nov 8, 2017

paket.references is empty (but created during convert-from-nuget)
Paket 5.122.0 gives me that error message on this project file:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net462</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Remove="node_modules\**" />
    <EmbeddedResource Remove="node_modules\**" />
    <None Remove="node_modules\**" />
    <Compile Remove="www\**" />
    <EmbeddedResource Remove="www\**" />
    <None Remove="www\**" />
    <Compile Remove=".idea\**" />
    <EmbeddedResource Remove=".idea\**" />
    <None Remove=".idea\**" />
    <Compile Remove=".vscode\**" />
    <EmbeddedResource Remove=".vscode\**" />
    <None Remove=".vscode\**" />
  </ItemGroup>
  <Target Name="NpmInstall" BeforeTargets="Rebuild">
    <Exec Command="yarn">
    </Exec>
  </Target>
  <Target Name="BuildFrontend" AfterTargets="Build" DependsOnTargets="NpmInstall">
    <Exec Command="gulp dev:build">
    </Exec>
  </Target>
  <Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>

Here's the error:

 Paket failed with
 -> InvalidOperationException: Durch diesen Vorgang würde ein falsch strukturiertes Dokument entstehen.
    StackTrace:
    bei System.Xml.Linq.XDocument.ValidateDocument(XNode previous, XmlNodeType allowBefore, XmlNodeType allowAfter)
    bei System.Xml.Linq.XContainer.AddNodeSkipNotify(XNode n)
    bei [email protected](XContainer parent, String node)
    bei Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source)
    bei Paket.BindingRedirects.indentAssemblyBindings(XContainer config)
    bei Paket.BindingRedirects.applyBindingRedirects(Boolean isFirstGroup, Boolean cleanBindingRedirects, IEnumerable`1 allKnownLibNames, IEnumerable`1 bindingRedirects, String configFilePath)
    bei [email protected](String configFilePath)
    bei Paket.BindingRedirects.applyBindingRedirectsToFolder[a](Boolean isFirstGroup, Boolean createNewBindingFiles, Boolean cleanBindingRedirects, String rootPath, IEnumerable`1 allKnownLibNames, FSharpFunc`2 bindingRedirects)
    bei Paket.InstallProcess.InstallIntoProjects[a](InstallerOptions options, Boolean forceTouch, DependenciesFile dependenciesFile, LockFile lockFile, FSharpList`1 projectsAndReferences, FSharpMap`2 updatedGroups)
    bei Paket.UpdateProcess.SmartInstall(DependenciesFile dependenciesFile, UpdateMode updateMode, UpdaterOptions options)
    bei <StartupCode$Paket-Core>[email protected](Unit unitVar0)
    bei Paket.Utils.RunInLockedAccessMode[a](String rootFolder, FSharpFunc`2 action)
    bei [email protected](ParseResults`1 results)
    bei Paket.Program.processWithValidationEx$cont@37[a](Boolean silent, FSharpFunc`2 commandF, a result, Unit unitVar)
    bei Paket.Program.handleCommand(Boolean silent, Command command)
    bei Paket.Program.main()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants