Button url caching Dynamics CRM 4 issue - c#

I have added a custom button, with url + javascript by chaning the isv xml file, as described on
http://msdn.microsoft.com/en-us/library/cc150860.aspx
and all works fine. However, when I try and replace the file in the /ISV/ folder, it behaves the same as the original copy, I assume this is caching related. However, if I access the file from outside the CRM that is http://server/ISV/file.htm it has the latest and correct version. How do I get around this caching issue.
Thanks

So your ISV Option points to "/ISV/file.htm"? I think in the past I've noticed CRM's IIS site caching static files for 3 days. What I would do is when you replace your file.htm in your ISV folder, also update the ISV.config:
So change it to point to "/ISV/file.htm?vers=00001" and then increment each time you update the file.

Related

Pulling changes made in Umbraco back office to local host

So I'm tinkering with using Umbraco as a CMS for an MVC application. Of course, I run the site locally and publish to a server and use Umbraco for managing things like hero images, carousel text, and a few basic dynamic elements that are stored in Umbraco.
However, one can also modify the actual template .cshtml files as well through the Umbraco back office. The problem with that is that those changes won't be reflected locally, and any changes made in the Umbraco back office would get overwritten on the next publish.
Is there any way to 'pull' the changes made in Umbraco (without having to FTP in and download the entire site), or even better integrate it with git directly?
If I understood you correctly, Umbraco uSync package might help you:
https://our.umbraco.org/projects/developer-tools/usync/
It exports the changes in "uSync" folder locally - you can do this automatically or manually, and then you transfer those files on the server, and do import within Umbraco Dev section.
Yes use uSync for this but you should probably decide whether you edit your template files locally or on the server. Generally you would probably keep editing template files, CSS, js, locally and upload changes to your live site. However, if you are adding content, setting up a template for the first time, changing doc types, adding data types etc, these are all database changes so either; share the database on the server between your local and Server versions of the site; or use a tool like Courier or USync to replicate your changes between environments.

Bundle problems

I can't seem to get the javascript files to update in VS2013, asp.net using bundles. The image is after I have done a clean/rebuild, bundle clear and resetall, and deleted the browser history in IE (including cookies, website data, temp files and website files.) I have wasted day after day trying to get my site working. I have googled this a hundred times and found no satisfactory answers. What am I missing? There has got to be an easy way to do this.
As I said in the comment, don't use bundles during development of javascript or CSS files at all.
Just comment out the part where the bundle is rendered and include the corresponding files the classic way like this:
<script src="~/Scripts/myscript.js?v=#DateTime.Now.Ticks" type="text/javascript"></script>
When deploying the project remove that line and reactivate the previously commented bundle-rendering call.
Because the uri-parameter version string of the "classic-approach" is changing on each request you can be sure that you always have the latest version of javascript file and are not dependent on some CacheDependency of the Bundle-Framework to trigger or update (which apparently is not working all of the time).
Just don't forget to remove that manual script include so that your users' browsers can actually cache the resources.

Force The browser to use the fresh JavaScript file instead of the cached [duplicate]

This question already has answers here:
force browsers to get latest js and css files in asp.net application
(23 answers)
Closed 8 years ago.
I'm maintaining an asp.net 3.5 website deployed on IIS 6.0 and I have made some fixes to a javascript file "scormapi.js" and should copy it (just this file) to the client website server. My problem is that the script reference to to this file with its version is injected into the page through server side code:
ClientScript.RegisterClientScriptInclude("DWScormAPI.js", ResolveUrl("~/Scripts/scormapi.js?Version=3.3"))
Which means that the client browser will use the cached file if I just do a copy of the file. Is there anyway to force the browser to use the new copied version of the file without recompiling and deploying the dll.
Thanks
EDIT:
I thought of adding to the aspx pages that uses the js file a tag that reference this js file with a different version number, or maybe using jquery $.getScript(). But in this case I would have two script references to the same file on the same page and I wonder if there is anyway to tell the page use this version of the file instead of that version.
NB: This is not duplicate question. I'm asking whether there is an alternative solution that avoids me modifying my server side code and then do a recompile and full deployment. The duplicate question some folks are referring to is just not what I'm asking about.
The only way to 'force' a browser to fetch a file instead of used its cached version is to change the URL in some way. In our system, our 'url injection' includes a query string with a timestamp - looks like "...something.js/140324" for a file that changed yesterday.
Here are some ideas for updating the js file for your users.
You could have the ?Version= have a value that changes every X minutes which forces the client to load a fresh js file every X minutes when visiting the website.
If you really must detect it server-side you could let the ?Version= have the value matching the last edit info for that file. E.g. let the server find the file on the system and examine last edit info and append that info to the ?Version= url part.

ASP.NET Browser Cache causing issues

I have looked for answers to this question, but I am not sure if I am asking it right.
I am looking for what do developers do in this situation:
I am developing an ASP.NET C# applications. I have CSS and SCRIPT files, and I am using jQuery. I install my application to the Web Servers (or I have my customer install them). If I have made any changes to my script files by adding some new jQuery or something, my customers don't get that effect after I do an update. I assume that the reason is that their browsers cache the file on the local computer and they do now download the new file from the server.
In my development environment I clear the cache when I close the browser and on IE I tell it in options to always load from the server. That way when developing I never have cached data.
What is the best practice to make sure that if I do make changes, those files get refreshed on the client computers after I do an update? Is there something in Code I can do?
I really don't want to change the filename and update all my script references.
Thanks,
Cory
The traditional way is to append a query string argument to the end of the reference to the css/script file path. For example, if you append a build number as the query string, each version of the software will make its own request for the relevant resource.

C# asp.net application, changes to Site.css do not seem to affect Site.Master

I just started an asp.net c# project and I was trying to change the text-align of the .title and background color of the .header. I add the required code to the style sheet, but nothing changes in the header of the form. I'm probably missing something simple here, can someone point me in the right direction?
Stylesheets are usually cached by the browser to speed up browsing.
You can either force-refresh (SHIFT+F5) or append a value to the stylesheet path to cache-bust it.
style.css?v1
By changing v1 whenever you want a change to be forced out to all browsers, it will replace the cached version as resources are cached per URI.
Just try stopping your Local development server and do clean and build solution before running the application.
Even clear your temporary internet folder which may contain stale copy of your css file.
Right clicking in the markup view , you should see an options that says view in browser. This should reload anything cached.

Categories

Resources