Click here to Skip to main content
15,882,209 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
Actually i have mvc project and make js bundle dynamically. But after 1-2 day js file has been corrupt and then js action has stopped working then i'm copy all js to live server then application has worked fine.
Please tell my why js file has corrupt?

What I have tried:

still i don't have any idea regarding this issue.
Posted
Comments
Richard MacCutchan 16-Nov-18 9:34am    
Well I doubt that anyone here will be able to guess what caused it.
MadMyche 16-Nov-18 9:37am    
Please edit your post and include the code your "bundle", creation and the configuration. How do you know it is corrupted? What does the browser debugger show? Has it changed?
ZurdoDev 16-Nov-18 13:22pm    
How would we know what you are doing wrong?
Abhilask kumar 17-Nov-18 20:20pm    
Because when i replace live js with development js then worked fine. so i guess.
Abhilask kumar 17-Nov-18 20:14pm    
This is function which create js bundle dynamically.

public string register_JSBundle(string BundleName, string BundleJS, string Delimiter = ")E(", bool bEnableOptimizations = true)
{
if (BundleName.IndexOf("~/") < 0) BundleName = "~/" + BundleName;
if (Strings.IsNullOrEmpty(BundleName) || Strings.IsNullOrEmpty(BundleJS)) return BundleName;
Bundle oBundle = null;
try
{
string[] arrBundleJS = BundleJS.Split(new string[] { Delimiter }, StringSplitOptions.None);
BundleTable.Bundles.IgnoreList.Clear();
oBundle = new ScriptBundle(BundleName).Include(arrBundleJS);
if (BundleTable.Bundles.Contains(oBundle))
{ BundleTable.Bundles.Remove(oBundle); }
BundleTable.Bundles.Add(oBundle);
BundleTable.EnableOptimizations = bEnableOptimizations;
}
catch (Exception ex) { set_ErrorInfo(ex.Message, Info.Definition.ErrorSeverity.Warning, "", 10025); }
return BundleName;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900