I have a Word add-in defined by a manifest xml file with the following overriding:
<DefaultLocale>en-AU</DefaultLocale>
<DisplayName DefaultValue="[DEV] My Add-in">
<Override Locale="en-au" Value="[en-au] My Add-in" />
<Override Locale="en-ca" Value="[en-ca] My Add-in" />
<Override Locale="en-us" Value="[en-us] My Add-in" />
</DisplayName>
<SupportUrl DefaultValue="url-default">
<Override Locale="en-au" Value="url-au" />
<Override Locale="en-ca" Value="url-ca" />
<Override Locale="en-us" Value="url-us" />
</SupportUrl>
I want to test whether the overriding works when my add-in gets loaded in different regions. However, the add-in somehow always shows en-us config ([en-us] My Add-in and url-us for SupportUrl).
What I have done before re-inserting my dev add-in from shared folder:
pick another region/language/time-zone
cleared my %LOCALAPPDATA%\Microsoft\Office\16.0\Wef\ folder
change language settings in all browser types and clear the cache
change language preference in Word
The only thing US left I can find in my machine is the Window display language (which I have no other option to choose) and the keyboard, but I don't think that's where Word task pane gets locale code from.
I would appreciate if someone could point me to the right place for testing this locale overriding.
When re-adding the Manifest put in a new value or Office seems to cache some of the setting.
Related
Anyone knows if feasible to add an icon to deployed toolboxes ?
Mathworks's add-ons do have one, but can't figure out how to set one for custom deployed toolboxes:
I naively tried to manually edit .prj file and copy-paste icon markups as done for 'apptool' deployment but it doesn't work (packaging tool automatically erases added markups and no icon appears):
<deployment-project plugin="plugin.apptool" plugin-version="1.0">
<configuration build-checksum="1265605284" file="C:\MyApp.prj" location="C:\" name="MyApp" target="target.mlapps" target-name="Package App">
<param.appname>MyApp</param.appname>
<param.authnamewatermark>Me</param.authnamewatermark>
<param.email />
<param.company>MyCompany</param.company>
<param.icon>${PROJECT_ROOT}\icon_24.png</param.icon>
<param.icons>
<file>${PROJECT_ROOT}\icon_48.png</file>
<file>${PROJECT_ROOT}\icon_24.png</file>
<file>${PROJECT_ROOT}\icon_16.png</file>
</param.icons>
...
I've added a NuGet Source. It needs credentials but when I'm installing a package using install-package packageName nothing happens.
I tried the same steps on other PC and it works.
I'm using Visual Studio 2017 Professional.
Could someone please help me with the issue?
My NuGet sources
This is riddiculous that it does not prompt for credentials.
To make it work I had to do the following:
Download nuget.exe from Nuget download site
Remove my old package source
Go to NuGet Package Manager for Solution->Settings
Delete your Package Source
Run Command Line
Go to nuget.exe
Add package source with plain password in the command
nuget.exe sources Add -Name "YourPackageName" -Source "YourPackageAddress" -Username YourUserName -password YourPassword -StorePasswordInClearText
Done... phew
If Visual Studio does not prompt for credentials but the logging Output shows that you did not authenticate correctly, then go to
Control Panel\User Accounts\Credential Manager
and click "Windows Credentials".
You can remove stored credentials for nuget/github there. If they become invalid - for example because you regenerated a token - Visual Studio does not prompt to overwrite the invalid credentials, but after removing the credentials and restarting Visual Studio you do get the prompt.
I've documented more troubleshooting related to the NuGet.Config in this issue:
https://github.com/verybadcat/CSharpMath/issues/168
Source for solving this specific problem:
https://support.microsoft.com/en-us/help/4026814/windows-accessing-credential-manager (I found this via: https://developercommunity.visualstudio.com/content/problem/98692/nuget-package-source-is-not-prompting-for-credenti.html)
After many attempts to set password, reset password or whatever the only thing that helped me was adding this section to the NuGet.Config (located on the .nuget folder for the main solution)
NuGet.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="false" />
</solution>
<packageSourceCredentials>
<MySourceName> <!-- Name of nuget package source -->
<add key="Username" value="..." />
<add key="ClearTextPassword" value="..." /> <!-- This is for normal password-->
<!--if encrypted use key="Password"-->
</MySourceName>
</packageSourceCredentials>
</configuration>
One important notice - for any change to this file to take effect I had to restart VS
Remove the source from the Nuget Package Manager and add it with a new name.
Credentials popup might be not coming because you have earlier entered some other credentials or some other credentials is stored against the NuGet Package. You can goto Credentials Manager in your PC and check for all NuGet Credentials.
If you found any, Please remove them from there. And, then try to restart Visual Studio and enter the package source and Url again. This time you will get the popup to add credentials for sure.
I'm looking to use Cordova CLI instead of a home grown ant solution for command line management of a phonegap/cordova project. I'm wondering what parts of the directory tree, if any, should not be placed under version control?
It depends on you project and your workflow.
For a lot of projects, the ./www folder would be sufficient as already mentioned, however there are some other folders that could be good to have depending on what aspects of the cli you are using.
Examples:
./merges for platform specific HTML/CSS/JS overrides
./.cordova for cli hooks (like before_build, after_plugin_add, etc)
Plus anything else custom you might want to keep out of ./www during development. For example, I have a ./src folder and the contents are concatenated and added to ./www as part of our build process. Our unit tests are also outside of ./www.
Instead of including a specific folder, I have a .gitignore that keeps build artefacts like ./platforms/* and ./plugins/* out of version control.
2015 - Cordova 5.1.1 answer
After working for some time with a Cordova project from 3.4.0 to 5.1.1, here's my feedback!
My .gitignore file looks like:
*~
**~
platforms/**
plugins/**
The www / .cordova and other folders you need are versionned.
My .cordova folder is currently empty (I used to have some errors when no .cordova folder, maybe it's not the case anymore)
All the plugins and platforms should be registered into the config.xml file.
If you add plugins by command line, use cordova plugin add $pluginName --save --shrinkwrap -> it will add the plugin automatically to config.xml and fix the version number, making the Cordova project easier to share among developers.
Read more about it and about sharing cordova projects, by the feature author.
Having the plugins in config.xml permits the plugins to be installed on other developer computers when they install a platform. Without that they will need to add themselves the plugin.
Somehow the config.xml acts like a package.json for NPM projects. But I still don't know how to handle a new plugin added, as far as I know the plugins are only installed during platform installation, there's no npm insall/update equivalent (but you can uninstall/reinstall the platform).
Here's an example config.xml from my project:
<?xml version='1.0' encoding='utf-8'?>
<widget id="co.xxx" version="0.2.6" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
<name>xxx</name>
<description>
Your Knowledge Network
</description>
<author email="info#xxx.co" href="https://xxx.co">
xxx
</author>
<content src="index.html" />
<preference name="permissions" value="none" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-targetSdkVersion" value="22" />
<preference name="phonegap-version" value="cli-5.1.1" />
<plugin name="cordova-plugin-device" spec="1.0.1" />
<plugin name="cordova-plugin-console" spec="1.0.1" />
<plugin name="cordova-plugin-whitelist" spec="1.1.0" />
<plugin name="cordova-plugin-crosswalk-webview" spec="1.2.0" />
<access origin="*" />
<allow-intent href="*" />
<engine name="browser" spec="^3.6.0" />
<engine name="android" spec="^4.0.2" />
<plugin name="cordova-plugin-statusbar" spec="^1.0.1" />
</widget>
The platforms do not get automatically installed (as far as I know), but at least when an user install the platform, he'll get the right platform version!
Some other people are using Plugman, a tool intended to manage Cordova plugins (not tested yet).
Well what u control is your own choise, although, I would personaly only use version-control on the www folder, since is where all your coding and stored content is ( html, css, js, images, audio, etc ), all the rest will be static content (in most of the cases)
Unfortunately I can't add only a comment, so here's my reply for #blockhead and Sebastien Lorber:
It is not necessary to save files from folder 'platform' even file 'AndroidManifest.xml' (or any configuration file for other platform). You can specify your preferences in 'config.xml' and it will affects these generated platform specific configuration files (e.g. AndroidManifest) - see phonegap documentation.
Then you can have under version control only folder 'www' and file 'config.xml'.
If anyone wants to code of Cordova CLI android platform centered (Android Hybrid complex project) into subversion then these files can be excluded while developing with team:
// to exclude files into repo
.gitignore
.gradle
.idea
local.properties
android.iml
/build
/gradlew
/gradlew.bat
/gradle
CordovaLib/CordovaLib.iml
If anyone is having problems with an svn error while import project of Gradle option from disk only not inbuilt subversion client of android studio then the following link will be helpful to you:
https://stackoverflow.com/a/34633162/5287727
I have been a cordova dev since v2.9 and the typical advice of excluding the platform and plugin folders works most of the time.... except for when it doesn't.
I have noticed on a project that feels like it uses every plugin known to man that this mantra has broken down, and I am unable to easily go back and forth in version control and reliably produce a new build.
This is for a few reasons:
Apple changes things up, and as time goes along there are a number of cordova hacks that need to be added to a project to get it to be reliable. For example, iOS 10 added a requirement that if you use the camera, then you needed to specify what you were using it for - or the app would crash when you tried. While I was waiting for the camera plugin to fix this, I needed to edit the iOS source files, then some time later I needed to build an old version, and in crept the issues.
But the real pain is when plugins stray from the cordova way of doing things. This project I am referring to uses the Adobe Aviary / Image editing SDK. Their instructions are to install the plugin, copy over some sdk files downloaded separately, then install it again. I tried making a script that wouldn't kill it, but it has ended up just being that I now commit the plugins and platforms directory to the app - this way I can go back in time and reliably recreate a build.
Yes it adds more size to source control, yes I would love to do it "right", but it has bitten me hard. Just my $0.02
TL/DR - When you starting working with more than a couple of plugins, you might need to consider adding the platforms and plugins folder to source control
Update 2019-11-05
For the project I was referencing we have since made a commitment to just use things that integrate correctly, and now I believe it is better to not check platforms into source control at all. If the plugin doesn't work, the client should not be using it.
Cordova has also moved away from providing an upgrade path for platforms, instead requiring you to remove and add the platform again - this means that this workflow is the only way forward in my opinion.
In my application folder I have virtual application QA. There is a folder "help" which contains html and other static files. QA is using form authentication.
All files in help folder are accessible without authentication (for example, www.mypage.com/QA/help/test.html). I need to change this so that if user acces files in help folder (html files or any other static files) then user is redirecet to login page.
I was googling and the ony thing I have found is that this is something with Static file handling and mapping to asp. I am using IIS 6.
I have tried to add line like this
< add name="StaticHandler" type="System.Web.StaticFileHandler" path="*.html" verb="*" validate="true" />
to my web.config (that is in QA folder), but it doesn't help.
Actually, I do not understand this line and also I am new to web.config file administrating.
I also tried to put all static files from help folder into QA, but it also doesn't help.
Make sure you have added a config file to the directory that contains your static files that you want protected from anonymous users like so (this means you will have a second web.config file in the directory you are trying to protect). Which will deny any anonymous users (that is what the does).
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
IIS is serving your static files outside of the ASP.net pipeline. Besides adding the declaration you have added System.Web.StaticFileHandler you need to map the extension in IIS. In order to ensure that your .htm or .html files are passed through ASP.net and therefore authenticated.
In your root web .config file add
<system.web>
<httpHandlers>
<add path="*.html" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
Then you need to perform some operation in IIS. These directions apply to IIS 6.0
Open IIS Manager
Right click on your website and select properties
Click Home Directory -> Configuration (displays application extensions etc). You will need the path from a mapped extension already in use by asp.net. The best way to get this is to find an already mapped asp.net extension in the list like .aspx or.ascx, click Edit and copy the Executable path. The path should end in aspnet_isapi.dll.
Click Add
Paste in the previous executable path and the extension (in your case .html).
Repeat this process for any other file types you want handled by the ASP.net runtime.
To deploy to different azure environments I modify the csdef as part of the compilation step to change the host headers. Doing so requires building the cspkg once for each environment instead of being able to reuse the cspkg and specify different configs for deployment.
I would like to instead modify the csdef file of a cspkg after it has been created, without recompiling. Is that possible, and if so how?
I've done something similar to what you're after to differentiate between test and live environments. First of all you need to create a new .csdef file that you want to use for your alternate settings. This needs to be the complete file as we're just going to swap it out with the original one. Now we need to add this to the cloud project. Right click on the cloud project and select unload project. Right click on it again and select Edit [Name of project]. There's a section that looks a bit like this:
<ItemGroup>
<ServiceConfiguration Include="ServiceConfiguration.Test.cscfg" />
<ServiceDefinition Include="ServiceDefinition.csdef" />
<ServiceConfiguration Include="ServiceConfiguration.cscfg" />
</ItemGroup>
Add a new ServiceDefinition item that points to your newly created file. Now find the following line:
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
Then add this code block, editing the TargeProfile check to be the build configuration you're wanting to use for your alternate and ensuring that it points to your new .csdef file
<Target Name="AfterResolveServiceModel">
<!-- This should be run after it has figured out which definition file to use
but before it's done anything with it. This is all a bit hard coded, but
basically it should remove everything from the SourceServiceDefinition
item and replace it with the one we want if this is a build for test-->
<ItemGroup>
<!-- This is an interesting way of saying remove everything that is in me from me-->
<SourceServiceDefinition Remove="#(SourceServiceDefinition)" />
<TargetServiceDefinition Remove="#(TargetServiceDefinition)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetProfile)' == 'Test'">
<SourceServiceDefinition Include="ServiceDefinition.Test.csdef" />
</ItemGroup>
<ItemGroup Condition="'$(TargetProfile)' != 'Test'">
<SourceServiceDefinition Include="ServiceDefinition.csdef" />
</ItemGroup>
<ItemGroup>
<TargetServiceDefinition Include="#(SourceServiceDefinition->'%(RecursiveDirectory)%(Filename).build%(Extension)')" />
</ItemGroup>
<Message Text="Source Service Definition Changed To Be: #(SourceServiceDefinition)" />
</Target>
To go back to normal, right click on the project and select Reload Project. Now when you build your project, depending on which configuration you use, it will use different .csdef files. It's worth noting that the settings editor in is not aware of your second .csdef file so if you add any new settings through the GUI you will need to add them manually to this alternate version.
If you would want to just have a different CSDEF then you can do it easily by using CSPACK command prompt directly as below:
Open command windows and locate the folder where you have your CSDEF/CSCFG and CSX folder related to your Windows Azure Project
Create multiple CSDEF depend on your minor changes
Be sure to have Windows Azure SDK in path to launch CS* commands
USE CSPACK command and pass parameters to use different CSDEF and Output CSPKG file something similar to as below:
cspack <ProjectName>\ServiceDefinitionOne.csdef /out:ProjectNameSame.csx /out:ProjectOne.cspkg /_AddMoreParams
cspack <ProjectName>\ServiceDefinitionTwo.csdef /out:ProjectNameSame.csx /out:ProjectTwo.cspkg /_AddMoreParams
More about CSPACK: http://msdn.microsoft.com/en-us/library/windowsazure/gg432988.aspx
As far as I know, you can't easily modify the .cspkg after it is created. I guess you probably technically could as the .cspkg is a zip file that follows a certain structure.
The question I'd ask is why? If it is to modify settings like VM role size (since that's defined in the .csdef file), then I think you have a couple of alternative approaches:
Create a seperate Windows Azure deployment project (.csproj) for each variation. Yes, I realize this can be a pain, but it does allow the Visual Studio tooling to work well. The minor pain may be worth it to have the easier to use tool support.
Run a configuration file transformation as part of the build process. Similiar to a web.config transform.
Personally, I go with the different .csproj approach. Mostly because I'm not a config file transformation ninja . . . yet. ;) This was the path of least resistance and it worked pretty well so far.