Web API Help page not showing XML - asp.net-mvc-4

I have a Web API project in which I removed by hand Areas folder few months ago when we started development. Now after everything is finished I want to add API help pages but it is not working as expected.
I installed nuget package for help pages.
I uncommented line in HelpPageConfig.cs
I checked Generate documentation file (to App_Data folder)
When I open http://localhost:51665/help I get this: (No methods are shown)
Any idea what could be wrong? If I start new project from scratch everything works properly.

I suppose you've setup your project in two steps:
You should choose Build tab in API project Properties and set up XML Documentation file in Output section. For example: App_Data\XmlDocument.xml
Then you can updateHelpPageConfig.cs in method Register... in my case
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
When your project is in compilation process, take a look in output window, whether documentation is really generated.
Try to use older version of ASP.NET Help pages (version 5.2.2 works for me).
Install-Package Microsoft.AspNet.WebApi.HelpPage -Version 5.2.2

Related

Create DevExpress Dashboard in a project with asp.net core

Hello Everyone I am new in StackOverflow so I may can't describe my problem well But I try my best and I am conting on you to help me with this ;
I have problem in myproject asp.net core wanna build dashboard with devexpress I already followed a tuto by devexpress but it seem something doesnt match when I try to install a package with NuGet I can't find it I have already try to add the package source so it help me find it but still nothing , I really need to do somthing about it immediately .
Here is some link to know more about this issue
The package :DevExpress.AspNetCore.Dashboard
-the tips that I thought it could help me : https://docs.devexpress.com/Dashboard/119284/getting-started/build-end-user-dashboard-designer-applications/create-an-aspnet-core-designer?v=18.1
-the tuto I followed : https://docs.devexpress.com/Dashboard/119284/get-started/build-web-dashboard-applications/create-an-aspnet-core-dashboard-application
I use asp.net core version 2.0
DevExpress 17.2
Source: C:\Program Files (x86)\DevExpress
18.1\Components\System\Components\packages
In the tutorial you refer to, the Source path added by it downloads the corresponding packages to a local folder, but because you did not download it, you cannot find the corresponding package using the path in the reference document.
Please refer to this article, log in to the account on the DevExpress official website, and click the Obtain Feed URL, an url including your authorization key and api will be generated.
Then when adding the package source, change the Source path to the url and continue to follow the tutorial.

Bootstrapping Aurelia

Finally, I start to work with Aurelia. There is a starter kit available Here which facilitates initializing Aurelia. But it is a template which should be used within a Web Site template.
I have a pre-configured WebApi project and I want to use Aurelia in it. I've just added the starter kit files and folders to my project. But unfortunately it shows 27651 errors fo files in jspm_packages.
What am I doing wrong? Is there any Nuget bootstrapper for Aurelia available?
Start with the aspnetcore template from Here
You can use web api from the template.
You will be up and running in minutes.
If you are using Web API, starting from an MVC5 project might be faster.
The following link is an Aurelia starter kit with MVC5.
You will have to update it to the latest version of Aurelia, but I managed to make it work with web api 2 and oAuth authentication.
https://github.com/rmourato/Mvc5-Aurelia
A tutorial can be found here.
http://ruimourato.com/2016/01/26/running-aurelia-on-mvc5.html
Hope this helps.
Well you asked what the errors are from. First thing is that you should exclude the jspm_packages folder from VisualStudios solution explorer Right click on it and mark 'exclude from project'.
Next, setup your project on source control (git) if not already and add the following to your git .ignore file
jspm_packages/
node_modules/`
I would suggest creating a second project aside from your WebAPI project that can contain static html, css and js files and do your Aurelia application there separate from your Web API project but in the same solution.
I could possibly give you a solution that is already setup, that shows how to use web api along with aurelia. But it would take some time for me to setup.
For all of my projects using Aurelia, I use the aurelia-cli which you get through npm and I would also recommend this approach.
You can be up and running with hello world in under 5 minutes.
You will then be able to build all the appropriate bits and pieces to talk to your api.
http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli/1

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.

IBM Worklight 6.0 - Dojo library uses localhost after deploy

I have a Worklight 6.0 project that uses the new Dojo 1.9 libs, I created an external dojo project, like the documentation suggested, then, in the main project properties, under "Dojo toolkit", it references this dojo19 project.
The project works on the local server, then I did "Run As" | "Build for Remote Server...", and entered the correct domain:port and context path, clicked Build, the *.wlapp files were updated. (I've also updated the settings for publicWorkLightHostname / publicWorkLightPort / publicWorkLightProtocol in the "Environment Entries for Web Modules" in the installed war to match the remote server names/port/protocol.)
But, after deploying both war and -all.wlapp file, accessing the app I get JS errors when it tries to refer to the dojo19 library:
The page at
https://<myIP>:9443/<myproject>/apps/services/www/ /mobilewebapp/default/IODMobile.html
ran insecure content from http://localhost:64441/dojo19/<myproject>/IODMobile/mobilewebapp/dojo/nls/core-web-layer_en-us.js.
The dojo19 is the project name in my Worklight developer workspace that I referred to above.
Why is it trying localhost? Seems there's a missing step here in deploying the dojo library project into Worklight.
Where are you trying to preview the application when you get the error message?
See the changes in Dojo in Worklight 6.0
If launching the application in emulator/simulator/device, see Billy Rowe's answer in this question
Partial copy/paste:
Step 1: Verify your application works in the Mobile Browser Simulator
with Provide Library Resources checked. If the Console log is showing
resources being served from the server, then these have to be copied
to your application before deploying to AVD or a device
Step 2: After you think you have all Dojo/resources within your
project, uncheck Provide Library Resources and test it again in MBS.
If it fails in MBS, then something is missing in your application that
is in the library/server. You can check Provide Library Resources and
retest to see if it shows you what that is. Not all resources are
shown, e.g. if there's a missing CSS file.
Also I would suggest to do all of this in the Development environment (that is, in Eclipse) before starting to deploy the .war file and .wlapp file etc... (which, BTW, I hope you're doing based on the new instructions for Worklight 6.0)
In the information center, it will show you how to uncheck the Provide Library Resources in the Console Log.
I think what you're running into is:
1) Something is being served from the Dojo Library/Server
2) A bug in 6.0 that used "localhost" instead of the IP of the host (your machine running eclipse). This is fixed in the 6.0 iFix. With this fix, you can run your app external to Studio and still use the Dojo Library/Server. Without this fix, you must have everything you need within your app.
Can you install the iFix and let us know if that fixed the problem?

Worklight fails to install customization jar

I have three projects in my workspace, two deploy to the server correctly, the third has just begun to give this error:
Failed to install and start project customization from file <path>MyProj-customization.jar
I've seen this before on other projects and usually it's sufficient to start the server for another project and come back to the one with problems. When that doesn't work the next recipe (found on developer works) is
Exit Eclipse/Worklight Studio
Delete <workspace>/WorkLightServerHome
delete project bin
Start Studio, rebuild
That also doesn't work. Finally there's a further recipe on developer works
When Eclipse is not running, go to:
1. <path-to-your-Eclipse-folder>\configuration\org.eclipse.osgi
2. Delete the .bundle* files
3. Start Eclipse
4. Build and deploy
Again this does not clear the problem, assuming I've understood step 2 correctly, I found exactly one file whose name is of the form .bundle* and a bundles directory with several sub-directories. I deleted only the .bundlexxx file.
Any other suggestions?
I would have expected that creating a new workspace would fix it, but on this occasion no such luck.
No true solution on this occasion. Normally a new workspace as a method of last resot has always worked in the past. In this case I found no alternative to reinstallation of Worklight.
In addition to the attempts you have tried, also try creating a new workspace and import the 'offending' project to it.
If all fails, have a new instance of Eclipse (Java EE, 4.2.2 SR2), re-install Worklight Studio and import the project.