ASP.NET Core Templates for VS 2019 in .2457

Hi
I’m testing new asp.net core templates from .2457 that seem to work almost fine in Water but not in VS 2019. In Water I only could not build React due to error :

E: NPM was not found - is Node.js installed?

Here are some screenshot from creating new projects in VS2019 (less typing) :





after running



The same templates created and run in Water work fine (except Node.js error).
Do I miss something for VS (libraries or setup) or I should wait for stable release?

BTW. I can confirm that all my other projects (.NET, Java, .NET Core) work fine. And sorry for so many screenshots.

Well, is it?

Thanks, logged as bugs://83569 for the errors in VS. Which template is that, also React?

Fixed the filename errors, someone form the VS team will need to look at the NRE Monday. thanx!


Should I setup the path in Water?

Right now we only finds the path via the registry… but I notice that check is broken — odd that Carlo didn’t notice that in testing. you can also set a <nodeExePath value in IslandPaths.xml manually; I’ll look at exposing the option in the UI for next week.

Thanks, logged as bugs://83570 to expose the option in the Fire/Water UI

bugs://83569 got closed with status fixed.

Hi
When can we expect the next Elements version to release? I’m especially waiting on a new stable release.

Hopefully today or tomorrow.

I’ve just checked .2459 and ASP.NET Core MVC/Rasor-based Web App template is still broken in VS2019 :

1>------ Build started: Project: WebApplication12, Configuration: Debug ------
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\_ViewImports.cshtml' does not exist.
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\_ViewStart.cshtml' does not exist.
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\Home\Index.cshtml' does not exist.
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\Home\Privacy.cshtml' does not exist.
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\Shared\_Layout.cshtml' does not exist.
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\Shared\_ValidationScriptsPartial.cshtml' does not exist.
1>RemObjects.Elements.targets(53,3): error : Razor File 'C:\repos\WebApplication12\WebApplication12\Views\Shared\Error.cshtml' does not exist.
1>Done building project "WebApplication12.elements" -- FAILED.
1>

ASP.NET Core Rasor-based Web App template creator also doesn’t work :


and then

Error () Razor File 'C:\repos\WebApplication13\WebApplication13\Pages\Error.cshtml' does not exist.	WebApplication13	RemObjects.Elements.targets	53	
Error () Razor File 'C:\repos\WebApplication13\WebApplication13\Pages\_ViewImports.cshtml' does not exist.	WebApplication13	RemObjects.Elements.targets	53	

other asp.net core templates creation works.

I also have a problem (after running working projects) with conneting to localhost:5000 in web browser - HTTP ERROR 404 :

~> Process WebApplication9 started
~> Trying to debug PID 18336
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://localhost:5000
~> Microsoft.Hosting.Lifetime: Information: Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
~> Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
~> Microsoft.Hosting.Lifetime: Information: Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: C:\Users\artur.redzko\Documents\RemObjects Software\Elements\Water\WebApplication9
~> Microsoft.Hosting.Lifetime: Information: Content root path: C:\Users\artur.redzko\Documents\RemObjects Software\Elements\Water\WebApplication9
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:5000/  
~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost:5000/
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
~> Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware: Warning: Failed to determine the https port for redirect.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 90.7994ms 404 
~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 90.7994ms 404
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:5000/  
~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost:5000/
~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 3.5237000000000003ms 404
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 3.5237000000000003ms 404 
!> Exception of type System.Net.Sockets.SocketException on thread 46C4
!> Message: An existing connection was forcibly closed by the remote host.

ASP.NET Core needs more testing on Windows (VS and Water).

Hm, these files aren’t generated from the template, but there’s also no errors (as you get for .gitignore), during creation? I’ll review the template again, but these work ok for me…

I’ll also check again re .gitignore, super sure if fixed that.

I’m confused — whats the difference between these errors and the other ones above?

Curious; that one seems unrelated to the the plate itself. which template is that, or can you send me the project?

When I choose ASP.NET Core Rasor-based Web App template and click Create for new project, first I get .gitignore message and then after compiling I get these two Error () Razor File 'C:\repos\WebApplication13\WebApplication13 errors.

For localhost:5000 I just created new project ASP.NET Core API app, compiled and run in VS2019.


I remember that this worked in previous build.

I will check all the stuff again tomorrow in the office on another PC and let you know.

Hm, io cant find any mentioning of “.gitignore” in the .vstemplates anymore. Sure you have the latest templates? @viktoriad, anything that can fail here on updating to cause VS2019 to not refresh those?

Ok. where do you get the 7 error messages?

I’ll check here, and have someone check on VS.

thanx!

I get these files (and no template errors) with the Razor template here. Note that there’s no “Pages” folder tough; the razor doesnt have that.

The React template has “Pages”, but that one too creates those files fine for me:

API app runs ok, and curl http://localhost:5000 gives me an empty response (prolly expected for an empty project?), no 404. Log says

~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://localhost:5000/favicon.ico
~> Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 20.4209ms 404
e```

just as it does for you.

I'll have someone else confirm on Windows.

I created ASP.NET Core MVC/Rasor-based Web App in Water that works fine :

This is a project from VS WebApplication1.zip (4.2 KB)
When you look into the project file, there are lines :

<Razor Include="Views\_ViewImports.cshtml" />
<Razor Include="Views\_ViewStart.cshtml" />
<Razor Include="Views\Home\Index.cshtml" />
<Razor Include="Views\Home\Privacy.cshtml" />
<Razor Include="Views\Shared\_Layout.cshtml" />
<Razor Include="Views\Shared\_ValidationScriptsPartial.cshtml" />
<Razor Include="Views\Shared\Error.cshtml" />

referencing files that are missing in directory.

For localhost:5000 issue I created new project ASP.NET Core API app, compiled and run in Water with the same result :

I will check if full uninstall and reinstall of Elements will help.

So essentially, the projects look the same hen created in Fire or Water, both have these files referenced. but the actual files are missing, when created in VS — correct?

which is odd, because this is in the template

  <Folder Name="Views" TargetFolderName="Views">
    <ProjectItem ReplaceParameters="true">_ViewImports.cshtml</ProjectItem>
    <ProjectItem ReplaceParameters="true">_ViewStart.cshtml</ProjectItem>
    <Folder Name="Home" TargetFolderName="Home">
      <ProjectItem ReplaceParameters="true">Index.cshtml</ProjectItem>
      <ProjectItem ReplaceParameters="true">Privacy.cshtml</ProjectItem>
    </Folder>
    <Folder Name="Shared" TargetFolderName="Shared">
      <ProjectItem ReplaceParameters="true">_Layout.cshtml</ProjectItem>
      <ProjectItem ReplaceParameters="true">_ValidationScriptsPartial.cshtml</ProjectItem>
      <ProjectItem ReplaceParameters="true">Error.cshtml</ProjectItem>
    </Folder>
  </Folder>

and I dont see why that would work for Water and nit work for VS, while e.g.

  <Folder Name="Properties" TargetFolderName="Properties">
    <ProjectItem ReplaceParameters="true">launchSettings.json</ProjectItem>
  </Folder>

apparently works fine.

That said, I also dont see .gitignore in the vstemplate, and yet you get an error on that, which really lead me to believe you have outdated templates. I’m not familiar off-hand with his VS2019 stores those (coz that changed since VS2015, when I last delay with it, so I’ll have Viktoria follow up with you on chasing this, tomorrow.

But can you check if you have templates in something like C:\Program Files (x86)\Microsoft\Visual Studio 16\Common7\IDE\ProjectTemplatesCache, and if so drill into the subfolders to find the Oxygene ASP.NET Core template and check what it’s .vstemplate file looks like? (im attaching what it SHOULD look iike: Project.vstemplate.zip (1.6 KB)

My bet is its out of date (and if it is, we’ll need to figure to why), when clearly the one in Water is up today.

I found original templates (zip files) and they are correct. Then after long searching, I located ProjectTemplatesCache at C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_73c02c30 although the directory was named ProjectTemplatesCache_{00000000-0000-0000-0000-000000000000} and contained only cache.bin file. I deleted this dir, reset the VS using devenv.exe options but the problem still exists.
It’s hard to find more info about ProjectTemplatesCache problems for VS 2019 as Microsoft changed many things (paths, etc.) comparing to older VS releases.

I will try again on another clean machine and let you know.

  1. I checked the fresh install on another machine. Exactly the same errors as on my laptop so it’s not ProjectTemplatesCache problem. This machine had only a stable release 10.0.0.2435 installed (no Preview installations).

  2. We also checked Fire on Mac, similar problems with creating new asp.net core projects. Here is sample error log:

     /Users/Cosina/Desktop/Fire.app/Contents/Resources/Mono/bin/mono 
     /Users/Cosina/Desktop/Fire.app/Contents/Resources/EBuild.exe "--setting:Elements:ToffeeSDKFolder=/Users/Cosina/Desktop/Fire.app/Contents/Resources/Toffee SDKs" "--setting:Elements:IslandSDKFolder=/Users/Cosina/Desktop/Fire.app/Contents/Resources/Island SDKs" "--setting:Elements:GothamXmlFolder=/Users/Cosina/Desktop/Fire.app/Contents/Resources/Gotham XMLs" "--setting:Elements:ReferencePathsXMLFolder=/Users/Cosina/Desktop/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial" --setting:Elements:IslandLddExePath=/Users/Cosina/Desktop/Fire.app/Contents/Resources/lld --setting:Elements:ToffeeHelperExePath=/Users/Cosina/Desktop/Fire.app/Contents/Resources/ToffeeHelper /Users/Cosina/Documents/WebApplication3/WebApplication3.sln --logger:fire --configuration:Debug --verbosity:normal --xml:/var/folders/6p/mwqprnk90mx4596sx474tt8w0000gn/T/WebApplication3.fire.xml --build --setting:TreatFixableErrorsAsWarnings=True
     RemObjects EBuild. An open source build engine for Elements and beyond.
         Copyright RemObjects Software 2016-2019. All Rights Reserved. Created by marc hoffman.
         Version 10.0.0.2459 (develop) built on bajor, 20191202-141346. Commit a4fccd8.
    
         E: Exception processing package reference Microsoft.Extensions.Logging.Abstractions:3.1.0 : An item with the same key has already been added. Key: packageIcon.png
         E: Exception processing package reference Microsoft.Extensions.Options:3.1.0 : An item with the same key has already been added. Key: packageIcon.png
         E: Exception processing package reference Microsoft.Extensions.Options.ConfigurationExtensions:3.1.0 : An item with the same key has already been added. Key: packageIcon.png
         E: Exception processing package reference Microsoft.Extensions.FileProviders.Physical:3.1.0 : An item with the same key has already been added. Key: packageIcon.png
            Project 'WebApplication3' failed to build.
            Project 'WebApplication3.Views' depends on project 'WebApplication3', which failed to build prior. Skipping.
            Solution 'WebApplication3' failed to build all projects.
    
  3. I want to notice two more issues that came up during the test (creating new projects) using VS2019 :

  • ASP.NET also fails on creating a new project
  • New project Wizard of VS 2019 - filtering from lists (combo boxes on top) doesn’t work correctly on Elements project types. Even when I selected Language, I still see all the languages. It was hard to filter ASP.NET Core projects for Oxygene (at first they didn’t show, using a filter triggered changes on the main list).

Sorry for multi issues report, I just wanted to notify all of them to not forget.

Thanks, logged as bugs://83610