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

Can't make EFCoreSample.Wasm project work on Visual Studio 2019 Preview 3 #4

Closed
salaros opened this issue Feb 20, 2019 · 9 comments
Closed

Comments

@salaros
Copy link

salaros commented Feb 20, 2019

First of all thanks for creating such a great project as Uno.

I'm struggling at building your WASM version of EFCore sample. I think that the content of this repo might be outdated and / or subjected to bit decay, since Mono WASM is being actively developed. I'm currently stuck a the point when a specific version of WASM SDK is extracted to %temp% folder, but its layout doesn't match the one hard-coded (???) into MSBuild .target files.

I'm still figuring out how things work in Uno, so fixing its complex build system is far beyond my current Uno skills (:smile:)

@jeromelaban
Copy link
Member

Thanks for trying out Uno!

For VS2019, updating to Uno.UI and Uno.Wasm.Bootstrap packages to the latest dev should be enough to work. The latest bootstrap contains a fairly recent version of mono-wasm. Let us know which error you're getting with the latest bits.

We've made great progress in Uno lately, and we'll be updating this repo as well with the latest.

@salaros
Copy link
Author

salaros commented Feb 20, 2019

Yeah, I forgot to tell you that I've already updated to the latest preview versions of Uno.* dependencies.

error : System.IO.DirectoryNotFoundException: 
 Could not find a part of the path 
  'C:\Users\Salaros\AppData\Local\Temp\mono-wasm-817b4795403\wasm-bcl\wasm'.

image

Please take a look at my fork and try to reproduce the problem I'm currently struggling with.

@jeromelaban
Copy link
Member

This error is generally caused by an invalid temporary mono-wasm folder, try deleting manually and rebuild

@salaros
Copy link
Author

salaros commented Feb 20, 2019

I've already tried it, the folder is recreated with the same content, which also 100% identical to the content of mono-wasm-817b4795403.zip downloaded by MSBuild.
I think that the the content of mono-wasm-817b4795403.zip is somehow different from what Uno.Wasm.Bootstrap expects it to be.

BTW I forgot to push this commit, the commit I was talking about above

@jeromelaban
Copy link
Member

Found the reason, there's an override of the mono sdk, just drop this line it was an override to make parts of roslyn work.

That being said, with recent version of mono-wasm, Roslyn needs to be configured differently (the assemblies are not readily available as they previously were) so you can use the UWP head "static" compilation mode in the mean time.

@salaros
Copy link
Author

salaros commented Feb 21, 2019

OK, seems like now a correct version of Mono Wasm SDK is downloaded, but I'm still getting problems

image

image

I will try to compile it using WSL and then on real Ubuntu later. However it would be great to have a compiled version (for Windows, Linux or both) in GitHub Releases, so people could try it.

Could you provide a compiled version in Releases, because the compilation process seems to be tricky and it's OK, because the underlying technologies are bleeding edge etc

P.S. It would be great to have a NuGet package of SQLite implementation ready to use with Uno, Blazor etc

@jeromelaban
Copy link
Member

For the first error, this is caused by the linker, you can see the error message when setting your build output in detailed or diagnostics.

For the second, you need to add this:
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.1" />
See : https://github.com/nventive/Uno.Wasm.Bootstrap#how-to-use-the-package. Just make sure to adjust the version number to the latest package available.

@salaros
Copy link
Author

salaros commented Feb 21, 2019

So for some reason, even if there is a reference to Microsoft.CodeAnalysis (I've tried adding sub-dependencies as project dependencies, below you will see why I did it)

image

and entries in LinkerConfig.xml file

image

image

Mono.Linker still cannot find Microsoft.CodeAnalysis.CSharp.Workspaces dependency for some reason. Probably using Visual Studio and Windows is a bad idea.

    Fatal error in Mono CIL Linker
    Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: resource EFCoreSample.Wasm.xml in EFCoreSample.Wasm, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.CodeAnalysis.CSharp.Workspaces, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft.CodeAnalysis.CSharp.Workspaces, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
       at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
       at Mono.Linker.AssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
       at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
       --- End of inner exception stack trace ---
       at Mono.Linker.LinkContext.Resolve(IMetadataScope scope)
       at Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies(LinkContext context, XPathNodeIterator iterator)
       at Mono.Linker.Steps.ResolveFromXmlStep.Process()
       --- End of inner exception stack trace ---
       at Mono.Linker.Steps.ResolveFromXmlStep.Process()
       at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
       at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
       at Mono.Linker.Pipeline.Process(LinkContext context)
       at Mono.Linker.Driver.Run(ILogger customLogger)
       at Mono.Linker.Driver.Execute(String[] args, ILogger customLogger)
    C:\Users\Salaros\.nuget\packages\uno.wasm.bootstrap\1.0.0-dev.196\build\Uno.Wasm.Bootstrap.targets(118,5): error : System.Exception: Failed to execute the linker

@jeromelaban
Copy link
Member

If you had used it under any other platform it would have been the same :)

The last issue you're mentioning is an Uno.Wasm.Boostrap issue with the linker, where the Microsoft.CodeAnalysis.CSharp.Workspaces assembly is not part of the referenced assemblies, because there are no code references to it when building the main assembly (all types are internal) and Roslyn loads it via reflection.

I've disabled the linker in #5 until this gets fixed, so you can get the sample running, and the compilation working.

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

No branches or pull requests

2 participants