Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

asp.net bundle

Posted on 2016-11-05
8
Medium Priority
?
84 Views
Last Modified: 2016-11-15
http://madskristensen.net/post/performance-tuning-tricks-for-aspnet-and-iis-7-e28093-part-2

I followed exact same way above but my website still have alert below.
The only different is the folder name. Do you have any ideas how to fix it?

Sequence contains no elements

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Sequence contains no elements

Source Error:


Line 113:                string absolutePath = HostingEnvironment.MapPath(relativePath);
Line 114:                FileInfo[] files = FindFiles(absolutePath);
Line 115:                DateTime lastModified = files.Max(f => f.LastWriteTime);
Line 116:
Line 117:                int index = relativePath.LastIndexOf('/') + 1;
0
Comment
Question by:ITsolutionWizard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 23

Expert Comment

by:Snarf0001
ID: 41875511
What version of .net are you running?
Have you looked at the nuget optimization package?  It's generally included in most project templates in VS, and will do 99% of the underlying work for you (including watching for file modifications and rewriting the bundle).

Very efficient, and no point re-inventing the wheel.

If for some reason you can't use it, would need more info on your file structure and code to see what the problem could be.  But looks like it's not finding the files, which "possibly" could be due to a lock when overwriting.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41875517
Framework 4.0
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41875648
Any ideas?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 23

Expert Comment

by:Snarf0001
ID: 41876242
If it's 4.0, I would try the MS bundling package.
Nuget under:
https://aspnetoptimization.codeplex.com/

You have to modify some global.asax items and add a few things, but documentation and online samples should get you there.  Very quick and easy to use and does most of the heavy lifting.

If you make a new project it should already be included, which may help in the setup steps just for reference.

If you don't want to use that, as mentioned, would need more details on file structure, and what / when / how often your getting exceptions.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41876386
Sound good but how to use it !?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 41876965
You need to debug your FindFiles method--it's returning no items.
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 41877347
I downloaded it and how to work with my existing solution ?
0
 
LVL 1

Author Closing Comment

by:ITsolutionWizard
ID: 41889008
FindFiles works to me
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question