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

conversion to elmish 2.0 #32

Closed
wants to merge 1 commit into from
Closed

conversion to elmish 2.0 #32

wants to merge 1 commit into from

Conversation

et1975
Copy link
Member

@et1975 et1975 commented Feb 6, 2018

using netstandard2.0 Elmish package dependency.

@et1975 et1975 changed the title partial conversion to elmish 2.0 WIP: partial conversion to elmish 2.0 Feb 6, 2018
@et1975 et1975 closed this Feb 7, 2018
@et1975 et1975 reopened this Feb 7, 2018
@et1975
Copy link
Member Author

et1975 commented Feb 7, 2018

The good - everything builds at this point, the bad - WPF + SDK still don't play nice together and something is still borked - all the samples crash at runtime. I only tried it on small headless VM, so maybe someone else could track down the reason.

@2sComplement
Copy link
Collaborator

Do the samples still work in Windows?
Also, does this invalidate #8?

@et1975
Copy link
Member Author

et1975 commented Feb 8, 2018

Do the samples still work in Windows?

see the above "samples crash" ;)

does this invalidate #8?

Good point, I think we can still build for 4.5 if needed, but it's not in the current version of the Elmish package (461 is though).

@et1975
Copy link
Member Author

et1975 commented Feb 8, 2018

Come to think, the whole NetStandard was introduced to address multi-targeting mess, so probably should just use netstandard1.1 to target all the compatible platforms (including net45) at once.

EDIT: scratch that, FSharp.Core doesn't support netstandard1.1, so net45 + netstandard1.6 + netstandard2.0 it is.

@et1975 et1975 mentioned this pull request Apr 26, 2018
@et1975 et1975 changed the title WIP: partial conversion to elmish 2.0 conversion to elmish 2.0 Apr 26, 2018
@et1975
Copy link
Member Author

et1975 commented Aug 24, 2018

No longer needed

@et1975 et1975 closed this Aug 24, 2018
@cmeeren
Copy link
Member

cmeeren commented Aug 24, 2018

Thanks! :)

@cmeeren
Copy link
Member

cmeeren commented Aug 25, 2018

@et1975 Having trouble with the build script, or specifically, building XAML projects from the command line. When converting the XAML projects to the new project format, did you manage to get them to compile from the command line? When I do dotnet build in a XAML project directory and have

<LanguageTargets>$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>

In the project file, I get the following error:

C:\Program Files\dotnet\sdk\2.1.400\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets(41,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.400\15.0\Bin\Microsoft.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. [D:\Code\GH\Elmish.WPF\src\Samples\OneWaySeq.Views\OneWaySeq.Views.csproj]

I guess this is because $(VisualStudioVersion) doesn't make sense outside VS. If I instead use your version from this PR,

<LanguageTargets Condition="Exists('$(MSBuildProjectDirectory)\$(AssemblyName).csproj') AND Exists('$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets')">$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>

then I instead get another error:

MainWindow.xaml.cs(9,13): error CS0103: The name 'InitializeComponent' does not exist in the current context [D:\Code\GH\Elmish.WPF\src\Samples\OneWaySeq.Views\OneWaySeq.Views.csproj]

Which I suppose is because the targets aren't included at all (since the condition fails).

Did you manage to get the XAML projects to compile from the command line / build script?

@et1975
Copy link
Member Author

et1975 commented Aug 25, 2018

Yes, it compiled on my windows VM, but this looks familiar, I think you need something like this cludge to make sure dotnet finds the framework targets and XAML codegen kicks in.

This is the issue, I believe: dotnet/project-system#1467

@cmeeren
Copy link
Member

cmeeren commented Aug 25, 2018

Thanks! I've had a look at that issue previously, but didn't find a solution for making it compile.

As for the file you linked to, I don't know what do to with it. I tried saving it in the project folder of one of the view projects, but it still fails with the same errors.

For now, I have simply excluded the samples from the build target.

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

Successfully merging this pull request may close these issues.

3 participants