Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Adam Granicz
@granicz
namely that subfolders under node_modules get squashed into node_modules
any idea how to resolve that?
Adam Granicz
@granicz
ok, the solution was:
  <Target Name="CopyFiles" AfterTargets="Build">
    <Copy SourceFiles="@(ExtraFiles)" DestinationFolder="../../build/%(linkBase)/%(RecursiveDir)" />
  </Target>
so using %(RecursiveDir) to match the whole directory fragment of the include pattern
Adam Granicz
@granicz
@Jand42 Any word from the FAKE folks about our build script?
András Jankó
@Jand42
@granicz This is the full situation: Many WS repos still use FAKE4 API, although with FAKE5 libraries (legacy API still available in them). The MSBuild environment variable setup that has been fixed/improved with FAKE5 has not been backported to FAKE4 API (ant won't be). There is a script by @Tarmil to convert repos automatically to FAKE5 that uses only a minimal own build.fsx (most WS bindings/libraries), WS core itself needs some more work, on it. But in the meanwhile I have put in a minor fix to set necessary env vars our FAKE4 legacy version: dotnet-websharper/build-script#2
So you can now pull the latest paket.lock update from WS repo, and build it with VS2019 only (should work for any of the 3 versions of VS2019 with standard install locations)
Adam Granicz
@granicz
will try, thanks
Adam Granicz
@granicz
now getting:
S C:\dotnet-websharper\core> .\build.cmd
Paket version 5.230.0
Starting full restore process.
Checking for uncommitted changes in C:\dotnet-websharper\core\paket-files\wsbuild\github.com\dotnet-websharper\build-script
Performance:
 - Disk IO: 11 milliseconds
 - Runtime: 3 seconds
Paket failed with
-> Checkout to C:\dotnet-websharper\core\paket-files\wsbuild\github.com\dotnet-websharper\build-script failed.
   Message: It seems there are uncommitted changes in the repository. The changes must be committed/discarded first.
   Message:
PS C:\dotnet-websharper\core> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
PS C:\dotnet-websharper\core>
András Jankó
@Jand42
wipe paket-files to be sure
and a git clean -dfx, Paket depends on temp files
Adam Granicz
@granicz
I did, still getting warnings:
Building project: WebSharper.Compiler.sln
  C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe  WebSharper.Compiler.sln /t:Build /m  /nodeReuse:False  /v:m    /p:RestorePackages="False" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+ErrorLogger,"C:\dotnet-websharper\core\packages\build\FAKE\tools\FakeLib.dll"
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.

C:\dotnet-websharper\core\src\compiler\WebSharper.Core.JavaScript\WebSharper.Core.JavaScript.fsproj.metaproj : warning
MSB4078: The project file "src\compiler\WebSharper.Core.JavaScript\WebSharper.Core.JavaScript.fsproj" is not supported
by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.Compiler\WebSharper.Compiler.fsproj.metaproj : warning MSB4078: The p
roject file "src\compiler\WebSharper.Compiler\WebSharper.Compiler.fsproj" is not supported by MSBuild and cannot be bui
lt.
C:\dotnet-websharper\core\src\compiler\WebSharper.Core\WebSharper.Core.fsproj.metaproj : warning MSB4078: The project f
ile "src\compiler\WebSharper.Core\WebSharper.Core.fsproj" is not supported by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.InterfaceGenerator\WebSharper.InterfaceGenerator.fsproj.metaproj : wa
rning MSB4078: The project file "src\compiler\WebSharper.InterfaceGenerator\WebSharper.InterfaceGenerator.fsproj" is no
t supported by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.Compiler.FSharp\WebSharper.Compiler.FSharp.fsproj.metaproj : warning
MSB4078: The project file "src\compiler\WebSharper.Compiler.FSharp\WebSharper.Compiler.FSharp.fsproj" is not supported
by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.Compiler.CSharp\WebSharper.Compiler.CSharp.fsproj.metaproj : warning
MSB4078: The project file "src\compiler\WebSharper.Compiler.CSharp\WebSharper.Compiler.CSharp.fsproj" is not supported
by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.FSharp\WebSharper.FSharp.fsproj.metaproj : warning MSB4078: The proje
ct file "src\compiler\WebSharper.FSharp\WebSharper.FSharp.fsproj" is not supported by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.CSharp.Analyzer\WebSharper.CSharp.Analyzer.fsproj.metaproj : warning
MSB4078: The project file "src\compiler\WebSharper.CSharp.Analyzer\WebSharper.CSharp.Analyzer.fsproj" is not supported
by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.CSharp\WebSharper.CSharp.fsproj.metaproj : warning MSB4078: The proje
ct file "src\compiler\WebSharper.CSharp\WebSharper.CSharp.fsproj" is not supported by MSBuild and cannot be built.
C:\dotnet-websharper\core\src\compiler\WebSharper.MSBuild.CSharp\WebSharper.MSBuild.CSharp.csproj.metaproj : warning MS
B4078: The project file "src\compiler\WebSharper.MSBuild.CSharp\WebSharper.MSBuild.CSharp.csproj" is not supported by M
SBuild and cannot be built.
and ultimately shortly thereafter an error:
dotnet "publish" "src/compiler/WebSharper.FSharp/WebSharper.FSharp.fsproj" --configuration Debug --framework netcoreapp2.0 --output C:\dotnet-websharper\core\build\Debug\FSharp\netcoreapp2.0\deploy --no-dependencies --no-restore
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

FSC : error FS0226: The file extension of 'C:\Program Files\dotnet\sdk\3.1.100\FSharp\fsc.exe' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli. [C:\dotnet-websharper\core\src\compiler\WebSharper.Core.JavaScript\WebSharper.Core.JavaScript.fsproj]
Running build failed.
Error:
System.Exception: Test Publish on "publish" "src/compiler/WebSharper.FSharp/WebSharper.FSharp.fsproj" --configuration Debug --framework netcoreapp2.0 --output C:\dotnet-websharper\core\build\Debug\FSharp\netcoreapp2.0\deploy --no-dependencies --no-restore
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1637.Invoke(String message)
   at Fake.DotNetCli.Publish(FSharpFunc`2 setPublishParams) in d:\a\1\s\src\legacy\FakeLib\DotNetCLIHelper.fs:line 471
   at FSI_0005.Build.publishExe@44(BuildMode mode, String fw, String input, String output, Boolean explicitlyCopyFsCore) in C:\dotnet-websharper\core\build.fsx:line 47
   at FSI_0005.Build.targets@64-1.Invoke(BuildMode mode) in C:\dotnet-websharper\core\build.fsx:line 65
   at FSI_0005.WebSharper.Fake.build@324(BuildMode mode, BuildAction action) in C:\dotnet-websharper\core\paket-files\wsbuild\github.com\dotnet-websharper\build-script\WebSharper.Fake.fsx:line 334
   at FSI_0005.WebSharper.Fake.build@324-1.Invoke(BuildMode mode, BuildAction action) in C:\dotnet-websharper\core\paket-files\wsbuild\github.com\dotnet-websharper\build-script\WebSharper.Fake.fsx:line 324
   at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
   at FSI_0005.WebSharper.Fake.MakeTargets@340-17.Invoke(Unit unitVar0) in C:\dotnet-websharper\core\paket-files\wsbuild\github.com\dotnet-websharper\build-script\WebSharper.Fake.fsx:line 341
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in d:\a\1\s\src\legacy\FakeLib\TargetHelper.fs:line 683
clearly, the path is wrong there - but those warnings above are concerning
also, note the version on my msbuild
Adam Granicz
@granicz
I am on Visual Studio 16.5.0 Preview 1.0 BTW - if that helps any, the paths are different for its tools
András Jankó
@Jand42
I have added Preview paths to build script. Run a .paket\paket update -g wsbuild then try build
Adam Granicz
@granicz
more unusual development:

  WebSharper.MSBuild.CSharp -> C:\dotnet-websharper\core\build\Debug\CSharp\net46\WebSharper.MSBuild.CSharp.dll
FSC : error FS2014: A problem occurred writing the binary 'C:\dotnet-websharper\core\src\compiler\WebSharper.Core.JavaS
cript\obj\Debug\net461\WebSharper.Core.JavaScript.dll': A call to StrongNameSignatureSize failed (Access is denied. (Ex
ception from HRESULT: 0x80070005 (E_ACCESSDENIED))) [C:\dotnet-websharper\core\src\compiler\WebSharper.Core.JavaScript\
WebSharper.Core.JavaScript.fsproj]
  WebSharper.MSBuild.CSharp -> C:\dotnet-websharper\core\build\Debug\CSharp\netstandard2.0\WebSharper.MSBuild.CSharp.dl
  l
FSC : error FS2014: A problem occurred writing the binary 'C:\dotnet-websharper\core\src\compiler\WebSharper.Core.JavaS
cript\obj\Debug\netstandard2.0\WebSharper.Core.JavaScript.dll': A call to StrongNameSignatureSize failed (Access is den
ied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))) [C:\dotnet-websharper\core\src\compiler\WebSharper.Core.Jav
aScript\WebSharper.Core.JavaScript.fsproj]
Running build failed.
Adam Granicz
@granicz
seems this wants me to run the build as admin?
András Jankó
@Jand42
I have pushed FAKE5 API conversion on https://github.com/dotnet-websharper/core/tree/fake5
I will create PR and test on CI server tomorrow. And looking into some (unrelated) build warnings.
Alexandre Péret
@AlexPeret

Hi! I'm trying to compile a WIG project under .NET Core 3.1. After creating it using the websharper-lib template, I've changed the WebSharperProject to InterfaceGenerator.

It compiles without any issue, but after referencing it in another project (Website), none of its classes are found.

Is there any limitation with WIG on .NET Core 3.1 at the moment?

sorry, I was to fast on asking. I've just add a reference to WebSharper.AspNetCore to the WIG project and it seems to work now.
András Jankó
@Jand42
@AlexPeret Hi! Weird, I wouldn't think you need to add AspNetCore for that. WebSharper 4.6 has a template for WIG in netstandard http://websharper.com/downloads (both VS templates and dotnet new)
But how WIG works is that none of the actual code makes it into the generated library, the result is based only on the definition exposed through [<assembly: Extension(typeof<MyExtension>)>]
Alexandre Péret
@AlexPeret
@Jand42 which one? I only see the one for websharper-lib, at this link
András Jankó
@Jand42
Yes, I need to update website... websharper-ext
Alexandre Péret
@AlexPeret
oh I see. After running donet new -u I realize I'm using 4.5
Alexandre Péret
@AlexPeret

@Jand42 I've upgraded the templates and all packages. Everything looks fine, but the embed resource from my WIG project.

At the WIG project, a .js file is embed like this:

module Res =
    let FileDropJs = 
        Resource "DomJs" "filedrop-min.js" |> AssemblyWide

module Definition =
    ...
    let Assembly =
        Assembly [
            Namespace "WebSharper.FileDropJs.Resources" [ Res.FileDropJs ]
            ...

// and finally
[<Sealed>]
type Extension() =
    interface IExtension with
        member ext.Assembly =
            Definition.Assembly

[<assembly: Extension(typeof<Extension>)>]
do ()

I also have this line in .fsproj:

  <ItemGroup>
    <EmbedResource Include="filedrop-min.js" />
    ...

But the filedrop-min.js is not found at the WebSite project, requiring me to add it manually to the www folder.

András Jankó
@Jand42
Hm, testing this in a moment
Alexandre Péret
@AlexPeret
well, just for sure, let me check if I used to add it manually in the prior version
András Jankó
@Jand42
if you use Sitelets, you should not need to, it should be unpacked to wwwroot\Scripts\WebSharper\WebSharper.FileDropJs folder and linked automatically
Alexandre Péret
@AlexPeret
@Jand42 ok. It's not there
András Jankó
@Jand42

I have just tried this with a new .NET Standard Extension and .NET Core Client-Server template, and the script link and file is both there. In your wsconfig.json, do you have

  "project": "site",
  "outputDir": "wwwroot"

(or similar setting through project vars?)

Alexandre Péret
@AlexPeret

this is from the WebSite project:

{
  "$schema": "https://websharper.com/wsconfig.schema.json",
  "project": "site",
  "outputDir": "wwwroot"
}

and this is from the WIG one:

{
  "$schema": "https://websharper.com/wsconfig.schema.json",
  "project": "extension"
}
but I didn't update the Client-Server fsproj, based on the new template. By there is a difference. Let me compare with new one
András Jankó
@Jand42
new one uses netcoreapp3.1, and some small API changes for that, but otherwise this should work the same
I just referenced my extension, used a dummy class from it in Client.Main (to have Sitelets runtime discover the dependency) and I got the script link
Alexandre Péret
@AlexPeret
hmm. Ok. I will debug it further and let you know. Thanks for your help!
just a last question. Do you have it embed in the fsproj as well?
András Jankó
@Jand42
yes, it needs to be an EmbeddedResource
now, I see, you had EmbedResource, maybe that's why :)
Alexandre Péret
@AlexPeret
ok. I just open the .dll with an editor and it is there
András Jankó
@Jand42
Yes, I had <EmbeddedResource Include="test.js" />. You pasted it with EmbedResource above, that looks wrong
Alexandre Péret
@AlexPeret
oops! you are right! shame on me.. :) thank you, again!