Rendering Spark views in Windows Azure ASP.NET MVC3 web app - azure

I've built a web application in ASP.NET MVC3 with Spark 1.5 view engine - works fine running on my local development machine, but when hosted on Windows Azure it can't find the Spark Views. I get the following standard error screen:
The view 'Logon' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Logon.aspx
~/Views/Account/Logon.ascx
~/Views/Shared/Logon.aspx
~/Views/Shared/Logon.ascx
~/Views/Account/Logon.cshtml
~/Views/Account/Logon.vbhtml
~/Views/Shared/Logon.cshtml
~/Views/Shared/Logon.vbhtml
Account\Logon.spark
Shared\Logon.spark
Seems to me that Spark is not searching the same folders as WebForms/Razor (since no ~/Views prefix), but I can't find where this is configured in Spark.
I've tried adding the following to the startup code:
settings.AddViewFolder( ViewFolderType.VirtualPathProvider,new Dictionary<string, string> { { "virtualBaseDir", "~/Views/" } } );
...but no change. Can't help feeling there's something blindingly obvious I'm missing.

You shouldn't need to add a ~/Views/ virtual path provider, that happens automatically by convention and the search paths above are just the output of the two view engines (Razor and Spark) differing slightly. Spark has a root view path of Views already it when it says Account\Logon.spark it is already in the Views folder.
I have a feeling that your spark views are not actually getting copied up to Azure when you package and deploy. It's similar to the MVC3 dlls before they were up there, you had to set them to copy locally to ensure Azure had access to them.
If you rename the Azure package to a .zip file and open it up to see if the views have been included as part of the content. If not, then try highlight one of the Spark files in Solution Explorer and check the Properties. Set the Copy to Output Directory to Copy Always and build and repackage your Azure project.
Your local bin folder in the project should also now have a Views Folder with the Spark views contained for verification.
Try and upload that package and see if it does the trick?
Hope that helps,
Rob

Related

How to develop foxx services using arangodb web interface

I am creating foxx services, right now I am doing it in VS Code and uploading the zip file in the services section with a mount point in DEVELOPMENT mode. Now I want to quick edit the foxx service in web interface itself. I was reading this possible but for some reason I do not get an option to edit it using web interface. Am I missing some configuration/setting or something.
One way to do rapid development with Foxx is to use an IDE that automatically uploads modified files to a local 'deployment' location.
For example, if you use WebStorm IDE, and edit the files in a directory that is integrated with GIT, then you can checkout and check in your code.
WebStorm (or other IDE's as well) have a feature where they monitor edited files, and then automatically copy those files to a destination location.
You can set it up so that it notices when you save a file, then rather than zip it and deploy it via the web UI, it just copies the files to the directory that Foxx is using as the source of your web service.
If you have the Foxx service running in 'Development' mode, then it recompiles every invocation, so it will pick up the newly edited changes that just got copied in.
You need to find the target directory that you have your Foxx Service running out of, when you enable Development mode it will tell you the path in the Web UI.
Not sure if you can do that with VSCode, but if you can then that's the easiest way to do it.

Bluemix XSP return "File does not exist" when setting manifest with multiple databases

I want to deploy multiple databases using the Bluemix XPages runtime.
In the manifest.yml file, I specified these database names:
test1.nsf,application.nsf
I tried to git, deploy using designer,and use the REST API, but the result on console still looks the same:
What am I doing wrong?
To do this would not actually require changes to the manifest file. Also, it isn't supported by the Bluemix tooling in Domino Designer, but it is still possible to do what you want.
Put simply, whatever you put into the "deployment directory" of your Bluemix app, will be deployed there. So if you want multiple NSF files to be deployed to Bluemix, then you need to make a copy of each NSF inside the deployment directory. Then deploy the application. (Designer does this copy step automatically during the deploy process for the NSF you have configured for Bluemix deployment, but as I say the tooling doesn't support multiple NSF deployment to a single Bluemix app.)
You can deploy with the Designer tooling or the CF CLI tool, but either way all your NSF files should be reachable on Bluemix after deployment and staging are complete.
You didn't make clear where in the manifest you were making changes, but seems you need to change it back so that only one NSF is listed in that setting. What's important here is the content of the deployment directory.
To the best of my knowledge: The Bluemix runtime takes ONE database that contains your application. Hence the runtime looks for a file test1.nsf,application.nsf which obviously doesn't exist.
It is the same patter as with other runtimes: e.g. you can't deploy 2 war files into a Websphere Liberty Java runtime.
My guess: the second database could work as a data source - you would need to configure it as a service (experimental in Bluemix) or host it on a Domino accessible to Bluemix.
Hope that helps

Upgrade Service Fabric Application

Is there a way to copy only modified files to Service Fabric.
I have a Service Fabric application containing an ASP. Net 5 application as service. Whenever am doing a change to a JavaScript file inside my ASP. Net 5 service, every time I need to copy the entire service fabric application package. Is there a command which allows to copy only the modified file?
The best way to accomplish this is to use diff packaging and app upgrade. See this link for more info: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-application-upgrade-advanced/. Diff packaging allows you to define an application package that only contains the package parts that you wish to upgrade. However, it only applies to a component of an application package, such as a Service or Code package for example. You can't create a diff package at the file level. So if you've only changed a single file in your code package, you must include that file along with every other file that belongs to the code package. You can't just include the single file that changed. But the benefit of diff packaging is that you'd only need to include that single code package. You wouldn't need to provide other Service's code packages, for example, assuming they haven't been changed.
Service Fabric SDK 2.5 brings in a preview feature called "Refresh Application".
Using this feature you can get quicker feedback of your code changes.
To enable that, set the following from project properties
Application Debug mode = Refresh Application.
More details and limitations can be found here:
https://sharepointforum.org/threads/speed-up-service-fabric-development-with-the-new-refresh-application-debug-mode.111162/
In Fabric Explorer you need to find the node where you Web Application is running. I my case that is _Node_0
By SF SDK design, local SF published file is under C:\SfDevCluster\Data_App\ . In my environment, the website file path is C:\SfDevCluster\Data_App_Node_0\Application1Type_App1\Web1Pkg.Code.1.0.0\wwwroot\
So you can also find your HTML, CSS, JS and other static resources under below path: C:\SfDevCluster\Data_App[node_id][application_type_and_instance_name][service_type_and_version]\
You can just modify the files in this folder, then the change will immediately apply to your local test web browser. Please notice if your service is hosted by micro-service running in several nodes, you may need to modify all nodes files because load balancer may access any folder files randomly.

Web Deploy Set Parameter using external file

We have an Website project that's hosted in Azure, and we use Web.config transforms for setting environment variables. However, our current approach for building the system for different environments is to build the project multiple times (currently this is 3), which is inefficient.
We'd like to move to using Web Deploy, as this would then set us up nicely for using Release Manager.
Our issue is around using Web Deploy parameters instead of web.config transforms; we need to substitute multiple xml elements, rather than single values.
After much research, I found these 2 articles which detail almost exactly what I'm trying to do
http://blogs.iis.net/elliotth/web-deploy-xml-file-parameterization
http://www.iis.net/learn/publish/using-web-deploy/parameterization-improvements-in-web-deploy-v3
Essentially I'm trying to replicate Scenario 5, but using a separate Set Parameter file for the value.
Unfortunately, in the examples, referencing an external xml file only works if it is on the target machine. Some testing with a colleague confirmed this; works on local machine, but not on Azure.
Is there a way I can force Web Deploy to look in a particular location for the external configuration files?
As you've already noticed, Web Deploy is only able to read replacement values on the local machine or on a UNC share. It can't read that specific file over HTTP.
If you're deploying to an Azure Web App, then one thing you could try would be to use Kudu/FTP to manually upload that file one level above your wwwroot folder. Then you could specify the file location like so:
D:\home\site\prices.xml:://book[#name='book1']/price
Of course this implies that you'd have to pre-upload this file before publishing to your site, so it's not a perfect solution, but it should work for what you're trying to accomplish.

Setting Up Continuous Deployment of a WPF Desktop Application

For a project I am currently working on, I need to create a setup application for an existing desktop application. The setup application will be downloaded from a website, and will download required files to the correct locations. When the application is started, it will look for newer versions of these files, download them if any exist, then start the application.
I am using Visual Studio Online with TFVC, linked to Azure. I have a test application set up so that when I trigger a build, Release Management finds the build directory, and moves the files to Azure Blob Storage, but prepends a GUID to the file names being transferred. So what I have in my storage container is:
{Some GUID}/2390/Test.exe
{Some GUID}/2389/Test.exe
{Some GUID}/2387/Test.exe
...
What I want in my container is the latest version of Test.exe, so I can connect to the container, and determine whether I want to download or not.
I have put together a NullSoft installer that checks a website, and downloads files. I have also written a NullSoft "launcher" that will compare local file versions with versions on the website (using a version xml file on the website), and download if newer, then launch the application. What I need to figure out is how to get the newer files to the website after a build, with automation being one of the goals.
I am an intern, and new to deployment in general, and I don't even know if I'm going about this the right way.
Questions:
Does what I am doing make sense for what I am trying to accomplish?
We are trying to emulate ClickOnce functionality, but can't use ClickOnce due to the fact that the application dynamically loads a number of DLLs. Is there a way to configure ClickOnce to include non-referenced DLLs?
Is there a best practice for doing what I'm describing?
I appreciate any advice, links to references, or real-world examples.
You are mentioning ClickOnce, which you investigated but can't use. Have you already tried an alternative: Squirrel? With Squirrel you can specify which files should be part of the installation, allowing you to explicitly specify which files to include even if you load them dynamically.
Link: https://github.com/Squirrel/Squirrel.Windows
Squirrel is a full framework for creating an auto-update application and can work with Azure Blob Storage hosting (and also CDN if you need to scale up)

Resources