DNX on VSO Host Build Controller - asp.net-core

When trying to build an ASP.NET 5 DNX project on VSO, I get the following error:
Cannot find DNX runtime dnx-clr-win-x86.1.0.0-beta6 in the folder:
C:\Users\buildguest.dnx\runtimes (119,5): Error : The Dnx Runtime
package needs to be installed. See output window for more details.
Does this mean that we cannot use the host build controller with DNX projects yet?

Found a great guide on how to install dnx on vso host.
https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5
Added the first PreBuild.ps1 script as a Powershell build step and it worked right away.

Since I still use it, to compile my code, to me, it's not dead.
I integrated some travis-ci config in py project, have a look at my .travis.yml for an update, but I count on my host name, my pc, and my internet connection to serve it as I do since few years:
dnx-install.sh
Note that DNX should be able to build DNX,
from it's source code, even marked as obsolete, and that It would be possible, but painfull, to write some scripts and use mono-roslyn directly ... still not a dead branch to me.

Related

SignalR: Cannot get js libraries in Visual Studio 2017 project

Trying to following this tutorial to get basic SignalR working:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/signalr?tabs=visual-studio&view=aspnetcore-2.2
I am using Visual Studio 15.9.7
the tutorial includes the instructions below, but when I follow them, the modal window disappears without any kind of message and I do not have the signalr javascript libraries anywhere. The lib/signalr folder isn't extracted into my application. Nothing.
I looked around to try and figure out where to download them manually. Nothing.
I tried running all the Package Console commands to try and get signalR. like this one: npm install #aspnet/signalr
Nothing.
Is there an easy and proven way to just get these js libraries?
In Solution Explorer, right-click the project, and select Add > Client-Side Library.
In the Add Client-Side Library dialog, for Provider select unpkg.
For Library, enter #aspnet/signalr#1, and select the latest version that isn't preview.
Add Client-Side Library dialog - select library
Select Choose specific files, expand the dist/browser folder, and select signalr.js and signalr.min.js.
Set Target Location to wwwroot/lib/signalr/, and select Install.
Add Client-Side Library dialog - select files and destination
LibMan creates a wwwroot/lib/signalr folder and copies the selected files to it.
Firstly, you can try to update your Visual Studio and check if it can help fix the issue.
Besides, to add the SignalR client library to the project, we can also use LibMan Cli command.
Run the following command to install LibMan (if not installed it before)
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
Run the following command to get the SignalR client library
libman install #aspnet/signalr -p unpkg -d wwwroot/lib/signalr --files dist/browser/signalr.js --files dist/browser/signalr.min.js

GlassFish 4.1.2 updatetool/pkg tools fail - missing pkg-bootstrap

Summary: The pkg-bootstrap.jar and related files are missing from the latest GlassFish 4.1.2 and this prevents the updatetool from running. What is the proper way to install and run updatetool on Windows 10?
Detail: I was working with the Java EE 7 tutorial and downloaded the Java EE 7 SDK Update 3 (not Web Profile) which is based on GlassFish Open Source Edition 4.1.2. I ran into a problem running the updatetool on Windows 10. When run, it gives the option to install itself but the installation fails. It looks like the update tool uses the pkg tool, and that uses a pkg-bootstrap to install itself the first time. However, this is no longer included in GlassFish 4.1.2. When the updatetool is run, it produces the following errors:
C:\glassfish4\bin>updatetool
The software needed for this command (updatetool) is not installed.
If you choose to install Update Tool, your system will be automatically
configured to periodically check for software updates. If you would like
to configure the tool to not check for updates, you can override the
default behavior via the tool's Preferences facility.
When this tool interacts with package repositories, some system information
such as your system's IP address and operating system type and version
is sent to the repository server. For more information please see:
http://wikis.oracle.com/display/updatecenter/UsageMetricsUC2
Once installation is complete you may re-run this command.
Would you like to install Update Tool now (y/n): y
C:\glassfish4>"C:\Program Files\Java\jdk1.8.0_121\bin\java" -Dimage.path="C:\glassfish4\bin\\.." -jar "C:\glassfish4\bin\\..\pkg/lib/pkg-client.jar" refresh
Error: Unable to access jarfile C:\glassfish4\bin\\..\pkg/lib/pkg-client.jar
C:\glassfish4>"C:\Program Files\Java\jdk1.8.0_121\bin\java" -Dimage.path="C:\glassfish4\bin\\.." -jar "C:\glassfish4\bin\\..\pkg/lib/pkg-bootstrap.jar" "C:\Users\[userid]\AppData\Local\Temp\pkg-bootstrap21687.props"
Error: Unable to access jarfile C:\glassfish4\bin\\..\pkg/lib/pkg-bootstrap.jar
C:\glassfish4\bin\pkg does not exist in either the latest Java EE 7 SDK Update 3 or the latest GlassFish 4.1.2. Some research on the nightly builds shows that the directory trees glassfish4/.org.opensolaris,pkg and glassfish4/pkg were removed between builds glassfish-4.1.2-b03-02_25_2017 and glassfish-4.1.2-b03-03_07_2017. I can't find anything that explains why they were removed or an alternate way to install the updatetool. My work around was to copy the two trees from glassfish-4.1.2-b03-02_25_2017 into c:\glassfish4 (from the Java EE 7 SDK Update 3) and that seems to work. But, I figure that if this was removed, there was a good reason for it, and I shouldn't be hacking it.
If there was a separate installation step for the package tool, I missed it. What is the proper way to get the updatetool to run on GlassFish 4.1.2?
I have jdk1.8.0_121 and jre1.8.0_121.
Thanks for your help.
I had the same problem as DevDevDev.
I went to the link in his post:
http://download.oracle.com/glassfish/4.1.2/nightly/index.html
Downloaded the archive:
glassfish-4.1.2-b03-02_25_2017
http://download.oracle.com/glassfish/4.1.2/nightly/glassfish-4.1.2-b03-02_25_2017.zip
Extracted the missing folders into my glassfish directory:
/glassfish4/pkg
/glassfish4/.org.opensolaris,pkg
As DevDevDev I have questions about why it was removed but it works for me...for now.... Hope it helps someone else. Thank you DevDevDev I would not have solved this without your post!
I was working with Java SE. Then I needed to work with JAX-WS, so I went into the same website as you.
Basically, it says that you have to:
Download the package (a compressed file with a folder called glassfish4)
Unzip the downloaded file (does not specify where)
voilá
It did not work for me, so I kept searching and I found this: https://forums.netbeans.org/post-91328.html
You just need to download this update from netbeans plugin Manager:
"Java EE Base"
Good luck!
I got the same problem too. It seems that glassfish 4.1 did not integrate the Update Tool, so as doc of oracle suggests, we'd better install SDK 6(glassfish 3). Here is Java EE 6 SDK Update 3, note that the version provided here is with JDK 7. If you already installed JDK in your windows 10, you may ignore it.
When you finish downloading the .exe file, you should not install SDK by double-click the .exe file. Instead, you should run below command:
java_ee_sdk-6u3-jdk7-windows-x64.exe -j [JRE-Home]
note, command here is the name of your .exe file and it needs console arg of JRE Home, mine command is as below:
java_ee_sdk-6u3-jdk7-windows-x64.exe -j D:\JDK\jre
It seems that unzipping the file using Windows explorer's zip support doesn't work properly. If you instead do as described in the README and run:
jar xvf glassfish-4.1.zip
The archive is extracted properly and all the needed pkg files are there.
What files do you need? I had the save problem I was looking for the files of tutorial. Finally I found them here: ..../glassfish4/docs/javaee-tutorial/

How to setup a TeamCity build for a ASP.NET 5 project

I'm trying to setup a CI server for a website that I'm developing, but I can't find any info regarding how to do it with the new ASP.NET 5.
I got you brother. This took me a few days to figure out. This configuration is on TeamCity v10 for a ASP.NET Core 1.0 RC2/preview2 project. As a bonus, I am including the step where it pushes to Octopus Deploy. You will need to install the dotnet teamcity plugin and the newest Octopus Deploy plugin with Push functionality. Here's an overview of the build steps:
First off, don't try to use dotnet restore to restore the packages. It won't work if you have internal nuget packages that are not compiled as .Net Core. This took forever to figure out. I would ignore trying to use dotnet restore until people have converted everything over to .Net Core or Microsoft fixes dotnet.exe to be more flexible.
Some of the stuff I read said to use the newest beta version of NuGet, 3.5. When I tried this, I would get the following error.
[14:30:09][restore] Starting NuGet.exe 3.5.0.1737 from D:\buildAgent\tools\NuGet.CommandLine.3.5.0-rc1\tools\NuGet.exe
[14:30:10][restore] Could not load type 'NuGet.CommandAttribute' from assembly 'NuGet, Version=3.5.0.1737, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I don't know what that means, and I don't care. Use 3.4.4 for now. Fill in the rest as appropriate.
The dotnet publish step is pretty straightforward. Make sure you provide the output directory because you want to use it in the final step. Also, be sure to specify an absolute path by using the %teamcity.build.workingDir% variable because of this bug. Otherwise it will fail to find your web.config file and not finish publishing the entire site. You'll be missing things like web.config and wwwroot!
Finally we Push to Octopus. This was very tricky for me. Note the part that says
%teamcity.build.workingDir%/published-app/**/* => OrderReviewBoard.1.0.0.zip
IF ANY PART OF THIS IS INVALID, YOUR STEP WILL FAIL WITHOUT EXPLAINING ITSELF!!! By invalid, I mean maybe you put a teamcity environment variable (like the %build.number% they show in all the examples) in that zip name that doesn't properly resolve. Or you specify a non-existent path. Or any number of things, you will see an error that says "[Octopus Deploy] Please specify a package to push". That means that one was never generated because that statement failed. I realize you want to have an auto-incrementing build number there. I'll leave it up to you to figure out how to do that.
Don't get all confused by what is running here. Octopus tries to explain it on their site, but it is hidden here. There is octo pack and octo push. The new version of octo pack is running out of sight, based on whatever statement you put in that "Package paths" box. Don't get sidetracked trying to create a nuspec package, or trying to use dotnet pack. These are dead ends for our purposes. Create a .zip file and move on with your life. Finally, notice the additional command line arguments I added. These help you out a tiny bit. They aren't required. Good luck.
We (the ASP.NET team) use TeamCity as the build server. Each repo has a build.cmd file, similar to this one. TeamCity simply invokes that file.
For Mac/Linux builds, there is a build.sh file.
At the moment you can try to use TeamCity plugin for .NET Core projects:
https://github.com/JetBrains/teamcity-dotnet-plugin
Please check these blog posts;
http://blog.coderinserepeat.com/2015/01/25/building-asp-net-5-projects-in-teamcity/
http://blog.maartenballiauw.be/post/2014/12/19/Building-future-NET-projects-is-quite-pleasant.aspx
Since there has been many changes to the ASP.NET Core world and I got asked about it a few times, I wrote down a step-by-step guide on how to setup a CI/CD environment using TeamCity for .NET Core. I think it is especially helpful for beginners.

Installing KVM Broke Current asp.net vnext Web Project

I installed the KVM using command line and my web project in VS2015 preview broke not compiling, but if add a new web project all works fine, how do uninstall the KVM so I can get my old project working. In this video Scott mention the issue but no solution, please see link, the video mention the issue at the 8:00 minute
video
1: http://channel9.msdn.com/Series/Whats-New-with-ASPNET-5/05 I change the to use the default alias but that did not work
NuGet Settings
I believe your versions are out of sync. Check your project.json and make sure you are not using different versions. I found that when I had 1 dependency that used 3.0.0-* it upgraded to beta2 from beta1. All of my other dependencies had beta1 actually defined. (Ex: 1.0.0-beta1). If the beta2 assembly shares the same dependency as one of your assemblies using beta1 it will override the older version of the shared assembly that is being used and causes your older version to fail.
You can remove any KRE package by deleting it from c:\Users\<user>\.kre\packages\. If you want to remove KRE and KVM then remove both the .kre folder completely.
However, you don't have to remove it to use a different version. You can either use kvm use <version> or, from VS, select the target framework in the project properties.
I have similar issue and I solved it by following steps.
In NUget Package Manager I selected only one nuget.org ( Disable myget.org by unselecting it)
I goto C:\Users\<>.kre\alias directory. Here you will find default.txt and I replace default.txt value with KRE-CLR-x86.1.0.0-beta1 ( If you downloaded latest version of Kre then this file change and it create problem for VS 2015 Preview)
After this close your solution and open it again. If possible then open as Administrator.
I hope this works for you as well.

Best mix of aspnet deployment tools

I know how many questions have been asked around this, but I still can't figure out the answer to my question.
I need to deploy an ASP.NET 4.0 site, and I want to do something like this:
Get latest version og the entire solution - a website and a couple class projects that are used by the webapp (I am doing this already using CCNet- not a problem)
Build and deploy in debug config to a test site
Build and deploy in a release configuration to a staging site
If everything looks fine on the staging site, I'll run a script that deploys the release build staging site, to 7-8 similar sites used by different customers on the same server. In the future this will be on another server.
There is MSDeploy (webdeploy 2.0), aspnet_compiler, MSBuild, Powershell (my weapon of choice..) and propably more ... I am not 100% sure what to use where?
I would love to mimick the "only deploy files needed to run the site" from the Vs2010 GUI assisted deployment, and I'd love to have the possibility of not touching some existing folders in the websites that we deploy to.
I feel like I should use MSDeploy a lot ... but I find it pretty hard to GET. I'm reading away in IIS.NET and I've heard the Scott Hanselman/Jon Arild Tørresdal podcast. I am not 100% sure where to start ... and I'm not a MSBuild expert, so Powershell is looking pretty good to me. But I feel I'm missing out on the right tools by going that way ...
What tool would you use in which step??
According to me, MSDeploy is build to achieve all of your needs with much more control. MSDeploy is the product of IIS team and it's far more feature rich.
Answers to your questions
Considerations: Svn as Source control, MSDeploy for deployment
You can use SVN Command line tool to get latest version of your source code in some temp directory and build it using MSBuild command line tool. Then you can create a Deployment Package or a Publish Content Package which can be deployed to specific environment. I am currently working on a project which can basically create a deployment package independent of the environment, means the pacakge can be deployed to any stage/test/live environment. Sample for creating a deployment package is...
msbuild C:\Projects\NimBuildDeployTestApp\NimBuildDeployWebApp/NimBuildDeployWebApp.csproj /t:package /p:Configuration=Release /p:PackageLocation=C:\Temp\DeployPackage\NimTestWebApp.zip /p:EnablePackageProcessLoggingAndAssert=true
Use MSDeploy command line tool to deploy the package as below
msdeploy -verb:sync -source:package=packagelocation -dest:CONFIGURABLE_ACCORDING_TO_YOUR_NEEDS
User Step 2 to build the solution in Release mode using MSBUILD and configure the dest parameter in msdeploy.
If everything seems fine on your staging server, run the deploymentToLive.batch file which will deploy a particular PublishContent/package on your live server. Execute 7 msdeploy scripts in same batch file or else use DFS (which is far more complex solution)
MSDeploy is definitely the way to go. One thing that you may consider is having a deployment package ready which can be deployed onto any environment of yours. What I mean by that is your web.config file won't be similar for all the envrionments, and hence create a deployment package which contains web.confif file for all the environments. Refer to my solution here
Hope this helps and gives you confidence in moving forward to automate your deployment process