Skip to content

Parsing an iOS classic project causes an exception #366

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

Closed
7sharp9 opened this issue Jul 8, 2015 · 38 comments
Closed

Parsing an iOS classic project causes an exception #366

7sharp9 opened this issue Jul 8, 2015 · 38 comments
Labels

Comments

@7sharp9
Copy link
Member

7sharp9 commented Jul 8, 2015

Using either FSharpProjectFileInfo.Parse or checker.GetProjectOptionsFromProjectFile

Causes a Microsoft.Build.Exceptions.InvalidProjectFileException to be thrown:

Microsoft.Build.Exceptions.InvalidProjectFileException: /Users/dave/Projects/sv_classic_ios/sv_classic_ios/sv_classic_ios.fsproj: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets: Project file could not be imported, it was being imported by /Users/dave/Projects/sv_classic_ios/sv_classic_ios/sv_classic_ios.fsproj: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets could not import "$(FSharpTargets)"
at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpProjectFileInfo..ctor (System.String fsprojFileName, Microsoft.FSharp.Core.FSharpOption1 properties, Microsoft.FSharp.Core.FSharpOption1 enableLogging) [0x000c2] in :0
at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpProjectFileInfo.Parse (System.String fsprojFileName, Microsoft.FSharp.Core.FSharpOption1 properties, Microsoft.FSharp.Core.FSharpOption1 enableLogging) [0x00001] in :0
at <StartupCode$FSharp-CompilerBinding>.$LanguageService+GetProjectCheckerOptions@328.Invoke (Microsoft.FSharp.Core.Unit unitVar0) [0x00082] in /Users/dave/code/xamarin/monodevelop/main/external/fsharpbinding/FSharp.CompilerBinding/LanguageService.fs:336
at FSharp.CompilerBinding.LanguageService.GetProjectCheckerOptions (System.String projFilename, Microsoft.FSharp.Core.FSharpOption1 properties) [0x00029] in /Users/dave/code/xamarin/monodevelop/main/external/fsharpbinding/FSharp.CompilerBinding/LanguageService.fs:328 at FSharp.CompilerBinding.LanguageService.GetCheckerOptions (System.String fileName, System.String projFilename, System.String source) [0x00036] in /Users/dave/code/xamarin/monodevelop/main/external/fsharpbinding/FSharp.CompilerBinding/LanguageService.fs:290 at <StartupCode$FSharp-CompilerBinding>.$LanguageService+ParseAndCheckFileInProject@351.Invoke (Microsoft.FSharp.Core.Unit unitVar) [0x00000] in /Users/dave/code/xamarin/monodevelop/main/external/fsharpbinding/FSharp.CompilerBinding/LanguageService.fs:351 at Microsoft.FSharp.Control.AsyncBuilderImpl+callA@805[FSharp.CompilerBinding.ParseAndCheckResults,Microsoft.FSharp.Core.Unit].Invoke (Microsoft.FSharp.Control.AsyncParams1 args) [0x0002b] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/fsharp-fsharp-1f79c04/src/fsharp/FSharp.Core/control.fs:809

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

I dont know why but $(FSharpTargets) is not being processed by FCS, this works fine during a build.

Unfortunately because of this exception we get no tooltips, completion or semantic highlighting in classic iOS at all, which is really bad and unshippable really.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

@rneatherway @dsyme Any ideas here?

@rneatherway
Copy link
Member

Any clues in the log output? I've never built an iOS project, so unlikely to be able to help.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

Theres no log output, it throws before that.

In an iOS classic theres an target like this:

  <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.FSharp.targets" />

Which looks like this:

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets"
            Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.targets')"/>

    <PropertyGroup>
        <!-- Version/fx properties -->
        <TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">MonoTouch</TargetFrameworkIdentifier>
        <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v1.0</TargetFrameworkVersion>

        <FSharpTargets Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets')">$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargets>
        <FSharpTargets Condition="'$(FSharpTargets)' == ''">$(MSBuildBinPath)\Microsoft.FSharp.targets</FSharpTargets>

        <DefineConstants>__MOBILE__;__IOS__;$(DefineConstants)</DefineConstants>
    </PropertyGroup>
    <Import Project="$(FSharpTargets)" />
    <Import Project="Xamarin.iOS.Common.targets" />

    <Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets"
            Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.targets')"/>
</Project>

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

From the error it looks like FSharpTargets is not being expanded or the way we are initialising msbuild is incorrect.

@rneatherway
Copy link
Member

Where exactly does that file live? Which version of xbuild is it under?
Perhaps not the one we are using.

On Wed, Jul 8, 2015 at 2:48 PM, Dave Thomas notifications@github.com
wrote:

From the error it looks like FSharpTargets is not being expanded or the
way we are initialising msbuild is incorrect.


Reply to this email directly or view it on GitHub
#366 (comment)
.

@dsyme
Copy link
Contributor

dsyme commented Jul 8, 2015

Is the FSharp targets file actually at the right path? There was a bug in fsharp/fsharp (fixed yesterday) that was putting it at the wrong place

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

It lives here:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/2.1/Xamarin.MonoTouch.FSharp.targets

F# seems to be ok, and everything build ok, so the target is found normally during a build.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

It could be that the expansion is triggering the same issue that android suffers from and the exception is being masked. It could be masked, perhaps, by the fact this target imports anotherXamarin.iOS.Common.targets which has all the monotouch tasks inside.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

I just checked and unified iOS project fail in the same way, so all in all no mobile platforms work because the checker options generator is broken for all of them.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

Slightly more detailed exception, it crashed in the ctor so its a bit nasty:

Microsoft.Build.BuildEngine.InvalidProjectFileException: /Users/dave/Projects/sv_classic_ios/sv_classic_ios/sv_classic_ios.fsproj: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets: Project file could not be imported, it was being imported by /Users/dave/Projects/sv_classic_ios/sv_classic_ios/sv_classic_ios.fsproj: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets could not import "$(FSharpTargets)" ---> Microsoft.Build.BuildEngine.InvalidProjectFileException: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets: Project file could not be imported, it was being imported by /Users/dave/Projects/sv_classic_ios/sv_classic_ios/sv_classic_ios.fsproj: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets could not import "$(FSharpTargets)" ---> Microsoft.Build.BuildEngine.InvalidProjectFileException: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.MonoTouch.FSharp.targets could not import "$(FSharpTargets)"
at Microsoft.Build.BuildEngine.Import.ForEachExtensionPathTillFound (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.Project project, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Func3 func) [0x002e1] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs:228 at Microsoft.Build.BuildEngine.Project.AddImport (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.ImportedProject importingProject, Boolean evaluate_properties) [0x0007b] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:1131 at Microsoft.Build.BuildEngine.Project.ProcessElements (System.Xml.XmlElement rootElement, Microsoft.Build.BuildEngine.ImportedProject ip) [0x0017b] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:935 at Microsoft.Build.BuildEngine.Import.Evaluate (Boolean ignoreMissingImports) [0x00088] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs:116 at Microsoft.Build.BuildEngine.Project.AddSingleImport (System.Xml.XmlElement xmlElement, System.String projectPath, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.String from_source_msg) [0x0016a] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:1217 at Microsoft.Build.BuildEngine.Project+<AddImport>c__AnonStorey4.<>m__0 (System.String importPath, System.String from_source_msg) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:1132 at Microsoft.Build.BuildEngine.Import.ForEachExtensionPathTillFound (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.Project project, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Func3 func) [0x00228] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs:208
--- End of inner exception stack trace ---
at Microsoft.Build.BuildEngine.Import.ForEachExtensionPathTillFound (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.Project project, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Func3 func) [0x00241] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs:211 at Microsoft.Build.BuildEngine.Project.AddImport (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.ImportedProject importingProject, Boolean evaluate_properties) [0x0007b] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:1131 at Microsoft.Build.BuildEngine.Project.ProcessElements (System.Xml.XmlElement rootElement, Microsoft.Build.BuildEngine.ImportedProject ip) [0x0017b] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:935 at Microsoft.Build.BuildEngine.Project.ProcessXml () [0x000aa] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:886 at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) [0x0012c] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:853 --- End of inner exception stack trace --- at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) [0x00144] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:856 at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName, ProjectLoadSettings settings) [0x0012a] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:542 at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr2/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.2/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs:508 at <StartupCode$FSharp-Compiler-Service>.$Service+projectFromFile@2360.Invoke (System.String fsprojFile) [0x00018] in /Users/dave/code/FCS/src/fsharp/vs/service.fs:2361 at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpProjectFileInfo.CrackProjectUsingOldBuildAPI (System.String fsprojFile) [0x000b0] in /Users/dave/code/FCS/src/fsharp/vs/service.fs:2364 at Microsoft.FSharp.Compiler.SourceCodeServices.FSharpProjectFileInfo..ctor (System.String fsprojFileName, Microsoft.FSharp.Core.FSharpOption1 properties, Microsoft.FSharp.Core.FSharpOption`1 enableLogging) [0x00054] in /Users/dave/code/FCS/src/fsharp/vs/service.fs:2453

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

Just a note, its definitely the import that trips it up:
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.FSharp.targets" />

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

So its trying to import
<Import Project="$(FSharpTargets)" /> and the property goup is not being expanded:

    <PropertyGroup>
        <!-- Version/fx properties -->
        <TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">MonoTouch</TargetFrameworkIdentifier>
        <TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v1.0</TargetFrameworkVersion>

        <FSharpTargets Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets')">$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargets>
        <FSharpTargets Condition="'$(FSharpTargets)' == ''">$(MSBuildBinPath)\Microsoft.FSharp.targets</FSharpTargets>

        <DefineConstants>__MOBILE__;__IOS__;$(DefineConstants)</DefineConstants>

@dsyme
Copy link
Contributor

dsyme commented Jul 8, 2015

Dors this file exist on disk? `‘$(MSBuildExtensionsPath32)..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets'`` ?

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 8, 2015

Yes it exists:
screen shot 2015-07-08 at 23 25 21

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Ok so FsharpTargets must be evaluated incorrect, when I finally managed to get the info out of the debugger:
The Final value of FSharpTargets is

/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild/12.0/bin/Microsoft.FSharp.targets

Which doesn't exist. This stuff is pretty awful to debug.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

I think there needs to be a double bind of FSharpTargets in the import file to cater for the two location checks.

@rneatherway
Copy link
Member

Ah, good debugging. It seems like MSBuildExtensionsPath32 is getting a different value in the two situations (probably because we are using MSBuild 12 in FCS). If you run xbuild /v:diag then we should be able to see the value it gets under xbuild.

Using a backup location of $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets like in normal .fsproj files is one approach.

The other is to reflection-bind to MSBuild like @dsyme suggested elsewhere, so that we can use 4.0 on Mono and 12.0 on Windows. That might also solve the android (cast) problem, but would require some testing.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Even if I add:

<FSharpTargets Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets')">$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargets>
<FSharpTargets Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargets>
<FSharpTargets Condition="'$(FSharpTargets)' == ''">$(MSBuildBinPath)\Microsoft.FSharp.targets</FSharpTargets>

I still get the last match, the first two do exist though???

@rneatherway
Copy link
Member

See my last comment, I think that MSBuildExtensionsPath32 is getting a different value under MSBuild12 on Mono. Can you check that in the debugger and compare to verbose xbuild?

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

I still have the debug session open, the value of MSBuildExtensionsPath32 is:
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild

@rneatherway
Copy link
Member

Huh, seems like a bug in the Mono MSBuild implementation then.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Ill try the backup you suggested, the one thats there currently never exists as far as I know anyway.

@rneatherway
Copy link
Member

Trouble is that my backup uses MSBuildExtensionsPath32 as well so I'm not sure it'll help.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

The last condition is based on '' though. The issue might be to do with some bug in the condition logic in the import processing maybe?

@rneatherway
Copy link
Member

Right, I suppose FSharpTargets might not be set until it has processed the whole file? What happens if you just remove that line? But then it works under xbuild.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

This is weird. It ends up setting FSharpTargets to:
/Library/Frameworks/Mono.framework/External/xbuild/Microsoft/VisualStudio/v/FSharp/Microsoft.FSharp.Targets

Even though MSBuildExtensionsPath32 is:
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild

I set it to:
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets

I have no idea why its doing that?

@rneatherway
Copy link
Member

It seems like something is lying to us! So MSBuildExtensionsPath32 is ending up as something different, but I'm not sure where that External is coming from. Is that where the iOS stuff lives?

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Yeah thats where the ios, mac and android targets are, Im not sure whats going on to be honest!

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

In terms of evaluated properties -
project.EvalulatedProperties.["MSBuildExtensionsPath32"] is /Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild

But if I slip an extra property in to see what was happening:

<BaseLocation>$(MSBuildExtensionsPath32)</BaseLocation>

Then BaseLocation is /Library/Frameworks/Mono.framework/External/xbuild

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Interestingly C# uses
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

MSBuildBinPath evaluates to:
/Library/Frameworks/Mono.framework/Versions/4.0.2/lib/mono/xbuild/12.0/bin

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

If the F# targets were installed to $(MSBuildBinPath)\Microsoft.FSharp.targets then everything would be ok.

When invoking xbuild the code must follow a different path than programmatic access to msbuild thats the only explanation.

The main question is how to resolve this?

@rneatherway
Copy link
Member

When invoking xbuild the code must follow a different path than programmatic access to msbuild thats the only explanation.

I absolutely agree. I suggest tracking down these paths so that we can behave the same as through xbuild. Perhaps it sets a default value for MSBuildExtensionsPath or something.

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Ha! I patched it so it uses a better backup location:

<FSharpTargets Condition="Exists('$(MSBuildBinPath)\..\..\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">$(MSBuildBinPath)\..\..\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargets>

And we get the old InvalidCast exception!
<SLUMP>

@7sharp9
Copy link
Member Author

7sharp9 commented Jul 9, 2015

Ok, so with a better safe path (See above) everything works as long as the assembly redirects are in place, which wont happen in XS, so to fix this we need the separate process invocation or reflection based calling.

How would reflection based calling work would that simulate binding redirects or ?

@7sharp9
Copy link
Member Author

7sharp9 commented Sep 22, 2016

I'll close this as XS doesn't use the cracker any more.

@7sharp9 7sharp9 closed this as completed Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants