Publish Web does not include some dependency assemblies - mysql

In the past I have been using batch files to prepare release packages targeting different environments such as test, staging and production, and then copy the files to the Web site folders through various means. The batch files may run XmlPreProcess to alter web.config for different environments.
Lately I am trialing the Publish Web feature of VS 2012, after installing Web Deploy 3 in the server side. The result is looking good for Hello World.
However, I have a WCF app: MyWcfApp.dll had dependency on MyWcfContracts.dll and MyWcfImplementation.dll which depend on MyData.dll and MySql.Data.dll, yes, I am using MySql. All these files appear in the build folder, say MyWcfAp\bin\Debug.
When running Publish Web, I got some warning: The database provider for this connection string, MySql.Data.MySqlClient, is not supported for incremental database publishing. Incremental database publishing is supported only for SqlClient as well as Entity Framework Code First models.
Then the other dependent assemblies such as MySql.Data.dll got not copied over to the server.
Apparently Publish Web does a lot "smart" things through analyzing Web.config and having a lot presumptions.
Question 1:
Is it good to use Publish Web to deploy WCF service?
Question 2:
Is it possible to run some pre-deployment script say running XmlPreProcess before the deployment so I could target different environments?
Question 3:
Is it possible to ask Publish Web not to analyze Web.config and then just copy every assemblies and files in the build folder?

For the specific issue (Question 3) of not copying over dependent-upon assemblies:
I am working with a small WCF Service Application that I am deploying to my local file system (then hosting the site in IIS) and had the problem of depended-upon assemblies not being copied to the local folder. The solution for me had two steps:
In the service's References, hi-light each reference you need to be copied and hit F4. In the new window make sure 'Copy Local' is set to 'true'.
Right click on the Service Project and select properties. Click the 'Package/Publish Web' section, and from the 'Items to deploy...' dropdown select 'All files in this project folder'.

Related

Azure DevOps deploy overwrites not always cshtml files

Sometimes it happens that when we do a deploy, the last committed files with extension cshtml, are not updated. We have not seen other type files being not updated. It could be that a file is in use and can't be overwrited. Is it possible to add an extra step to the deployment process so we can avoid this?
That is strange. If you are using the Azure App Service Deploy task within Azure Pipelines to deploy to your Web App, you have the option to Remove additional files at destination. Enabling this option deletes files in the Azure App Service that have no matching files in the App Service artifact package or folder being deployed.
Based on the chosen deployment method, there are other helpful additional deployment options like:
Rename locked files: Rename any file that is still in use by the web server by enabling the msdeploy flag MSDEPLOY_RENAME_LOCKED_FILES=1 in the Azure App Service settings. This option, if set, enables msdeploy to rename files that are locked during app deployment. This way, you can avoid deployment failures with ERROR_FILE_IN_USE errors.
Take App Offline: Select this option to take the Azure App Service offline by placing an app_offline.htm file in the root directory before the synchronization operation begins. The file will be removed after the synchronization completes successfully.
Having these in place can streamline your deployments and make them robust. Here is the complete reference for the task: Azure App Service Deploy task.

How to only download specific files from remote server instead of whole project?

I created a new project from remote sources and entered my servers data. PhpStorm instantly began to download the whole Magento project, even though I only need specific files for development, e.g. I don't need all the images or cache folders for my purpose. Now it takes 4-5 hours to download the whole project.
In NetBeans you can choose which folders you want to download to your machine, is this also possible in PhpStorm?
Yes it's possible.
You should have marked such unwanted folders as "Excluded from Download" --
See official help page for appropriate wizard step.
Other ways of creating a project:
Just create empty local project and then configure the rest manually (deployment etc); once done use "Browse Remote Host" and download folders/files you need.
Another way -- download all needed files locally first using you preferred program (e.g. FileZilla) and then just point to the project root folder in "Open" dialog -- IDE will create new project from those files.

Jhipster: Making a WAR file with client-configurable Datasource

My development team is working on a web application and has assigned me to research on how to make a client-side WAR file with a configurable Datasource.
This is the first commercial project of ours:
Language: Java / JavaScript(jQuery and AngularJS) / HTML / CSS
Database: MySQL
Development Tool: IntelliJ
Automation System: Gradle
Application Generator: JHipster
Version Control: SourceTree
At this time, our client has agreed to simply deploying the app on his own Amazon Web Server's MySQL database using an executable file (currently, a WAR file) delivered by us in a safe USB.
So far, the WAR file can be made with JHipster and deployed with no issue on our internal server. However, we did hard-code all the database-connection (JDBC) stuffs in a YML file under src/main/resources/config.
Naturally, our client has a database with totally different schema, usernames, and passwords. And the WAR file we are about to give him cannot be executed unless the datasource specs in there match his.
Because source codes cannot be extracted from a WAR, the client is not going to modify the datasource from his end. At the same time, he does not fancy giving us datasource information.
Thus, we are to come up with, quote, an executable file which allows him to configure the datasource the first time it is executed on his AWS.
Is there a way we can achieve this while not straying too far from the current deployment method (WAR file)?
Nothing specific to JHipster here, it's purely a Spring Boot question. You can either provide an application-prod.yml external to your war file or keep it internal but use placeholders referring to environment variables defined in your client server.
For more details, read the Spring Boot doc https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html

Publishing Lightswitch localy

I'm trying to publish ligthswitch on local network with from VisualStudio 2013,
I have installed IIS and launched web-deployment services. I Think I also installed all the possible features from web platform installer.
When I publish lightswitch app I get to this screen.
and I dont know how to get pass this service Url line. Whenever I type localhost or Computer name which is the server name, perhaps? I get an error
"Lightswitch must be run with administrative privileges to deploy to local host.
I fugured I could also just use import settings file. It could be alternative way.
but how do I create this xml file.
I've answered this for you before. You may have missed a step:
Open IIS
Locate "Default Web Site"
Right click and find Deploy -> Configure Web Deploy Publishing... (This step will create the XML file that you can use for Import Settings...
(If this menu option isn't available it means you haven't got the Management Service installed. And/or you haven't got the ALL of the Web Deploy 3.5 components installed.)

Windows Universal Apps: storing configuration

i come from web development where apps can have multiple config files for storing things like db connection strings, remote server endpoints, passwords and so on
so you have files like base.config, development.config, production.config, local.config and so on
according to the environment the app is running in the correct config file is loaded
is there any such system for Windows Phone and Windows Store apps?
if so, how can i define different configs for diffrent runtimes such as debug and production?
i would really like to avoid storing runtime config in code and then using crazy ifs
There isn't a built-in system for this, but it's pretty easy to mock up. Create and read a file with your config information then create different files for the different configurations. Create a pre-build step which copies the appropriate file for the desired configuration.
I'd probably name the files all the same but put them in different directories named for the $(Configuration) then copy from the $(Configuration) dir in my pre-build.
See Pre-build Event/Post-build Event Command Line Dialog Box on MSDN
There isn't an easy way to switch this at runtime since you can't write to the appx package after it's signed and deployed.