Visual Studio 2012 ASP.NET bundling fails part way through - asp.net

I'm trying to setup VS 2012's new bundling functionality (via the Microsoft.Web.Optimization package - read more here) and for the most part, everything is working alright. The problem is that the processing just gives up after ~15000 characters.
When I build and run the page, I get a bunch of failures because the JavaScript files that have been loaded are truncated halfway through a line in the middle of a function...
Has anyone else experienced this or does anyone have any insight into how resolve this issue?
--UPDATE--
I originally encountered this error using foo.AddDirectory("~/scripts/", "*.js"). Using foo.AddFile("~/scripts/bar.js") only results in the javascript errors when I include any jquery plugins. No errors are being thrown on the server.
--UPDATE2--
The problem was a result of the Web Optimization library not being up to date. I highly suggest that anyone attempting to use this retrieve the library via NuGet command line: Install-Package -IncludePrerelease Microsoft.AspNet.Web.Optimization. There are various versions of documentation and examples on the web, but the most current can be found using the above method and the most current documentation is that found in the answer below.

Do you have a small repro? My guess is that maybe there's an issue with the javascript files that are in the bundle.
Its also possible the minifier is choking on something and/or incorrectly minifying them.
If you are using the Scripts.Render helper, have you tried running with debug = true to make sure that everything works correctly with no bundling or minification?
Here's also the latest documentation which might be helpful: http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification

Related

The tag 'ChromiumWebBrowser' does not exist in XML namespace 'clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf'

I am attempting to add a CefSharp control to an AnyCPU project. I have followed the instructions here: https://github.com/cefsharp/CefSharp/issues/1714 and I thought I had everything working correctly. I pushed my changes to to SVN and then checked out a clean copy.
The first time I attempted to build using that clean copy, I received this error:
error MC3074: The tag 'ChromiumWebBrowser' does not exist in XML namespace 'clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf'. Line 18 Position 14.
as a result of this error, several other libraries fail to compile. If I attempt to build again, everything compiles fine.
I ran a diagnostic build, and, it appears that the CefSharp packages are in fact being installed from NuGet prior to this error and, the error occurs during MarkupCompilePass1.
This seems very, very similar to this issue: https://github.com/dotnet/project-system/issues/4158, however, in that case, it sounds as if the problem was resolved by switching from package.config to PackageReference, but, that approach did not seem to fix my error.
I have read https://www.xavierdecoster.com/post/2014/03/06/migrate-away-from-msbuild-based-nuget-package-restore.html as amaintland suggested in the issue I mentioned above, and, unless I'm misunderstanding, it's not a solution that I can use. For the time being, out continuous integration runs on CruiseControl (which isn't mentioned as a tool that supports automatic package restore out of the box), and we're stuck on VS 2013.
Right now the only option that I can find that seems like it might work is checking the NuGet packages into SVN. This is a last resort solution for me, but, lacking a better option, I don't know what to do.
If anyone has any insights or suggested steps, I would really appreciate the advice.

Could not find schema information for the element 'setting' VS 2015 ASP.Net

When building my web app, I get the following message (amongst 77 others, all similar, just for different elements in my web.config)
Could not find schema information for the element 'setting' VS 2015 ASP.Net
I have looked at the schema for the config,
looks Ok to me?
I have also other weird stuff going on, like When I add a new webpage, I get an HRESULT FAIL COM error. Ditto with trying to install NuGet packages.
This only started happening yesterday, on a large solution. I had reference errors after a merge, which I have now fixed. All projects target the same .NET version (4.5).
I have no build errors and everything works, except my recent work - a page that uses partials (worked fine until yesterday!). My colleagues are beginning to doubt me!
Does anyone have any ideas?
Deleting the 'bin' folder, then rebuilding seems to have cleared the messages.

Cannot Build Xamarin.Forms From Source Code

I have downloaded the Xamarin.Forms solution from GitHub and I am trying to build the solution. Visual Studio does not build, generating more than 70 errors, as simple as the one below:
"The type or namespace name 'IOnClickListener' could not be found (are
you missing a using directive or an assembly reference?"in
Xamarin.Forms.Platform.Android\AppCompat\ButtonRenderer.cs
When I investigate the code, I see that there is really no reference to Android.Views.View in the using statements, so it seems fair.
Am I making a mistake somewhere?
It's not easy to get to the answer without digging into the logs but here are some steps that have helped me in the past.
Android Specific Steps:
Check the logs for any problems that stand out, look at the top most error first and work your way down. Output window -> Show output from Xamarin Diagnostic
If you find unzipping problems you might have to visit the Xamarin folders to delete the zip causing problems and Xamarin will download a new one.
C:\Users{USER}\AppData\Local\Xamarin
If you get loads of Xaml and Resource errors you might have to delete the contents of the file.
Resources\Resource.Designer.cs
After deleting the content(not the file), clean the solution, rebuild the project.
If you still have problems try to either downgrade Xamarin.Forms or upgrade it.
Change Api level to a higher one on the project properties.
Hope one of these helps.

ASP.NET runtime error: Could not load file or assembly 'Interop.CertEnroll'

I have a ASP.Net 4.0 site that I am editiing in VS2010. Every # Master and # Page tag has the blue squiggle lines giving the following error:
ASP.NET runtime error: Could not load file or assembly 'Interop.CertEnroll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I know it is related to trying to load a 32bit dll into a 64bit application but I am not sure how to control it since I am not sure how this Iterop.CertEnroll client is evening being referenced.
I am targetting Any CPU for my builds.
My application still functions but it bothers me to see all of these warnings and I have seen hints that this may be causing issue with my AjaxToolkit server tags not being recognized.
Thank you!
Karl
I discovered this solution for you. Since I cannot reproduce the error, can't exactly say if it would resolve the error for you, but you can still try. Here is the crux of the story from the link:
If you compile against x86 platform instead of Any CPU platform (which makes the code to run against x64 platform on x64 systems by default), it will work fine.
All the best!
Make sure you are compiling against .NET 4 and not .NET 4 Compact Framework.
I had the same issue not long ago with this missing dependency.
Installing Microsoft Online Services Sign In provides the correct assembly, although I'm not sure why this would be required.
edit: I can't seem to find the article that pointed me to the above download.
This is a known bug they aren't going to fix. You can try suggested workarounds though.
TL;DR: Check your master page(s) if the ContentPlaceHolder tags are specified correctly, and your pages to see that the ContentPlaceHolder tag ids are correct.
Long answer:
For anyone facing this issue and if the other solutions do not work, here is another thing you could try. I was getting the same error, with all master and page tags highlighted with the error:
Could not load file or assembly Microsoft.Practices.ServiceLocation,
Version=1.3.0.0
My packages were all in order and I spent quite a lot of time trying to get it to work. Turns out the error was misdirecting and the actual error was missing ContentPlaceHolder tags in my nested master page.

Errors while compiling asp.net website

Hey guys,
i have a website, i want to place the compile code on the production server, now i took the code on the local machine and trying to compile source code on local machine, but whenever i compile the code, in one of my control(ascx.cs) file i am getting error that the control does not exists in current context, i checked everything, Inherits, CodeFile, even in the code behind(.cs) file, everything is perfect, even i get the control id in the intellisense, when i remove the control and again add the same using intellisense, the errors gets removed but after i publish site, the same error comes again....
Please reply with some suggestion/solutions.
I've had this issue before when referencing another project. It would give it intellisense, but then trying to compile would cause errors and take away intellisense. Removing and re-adding it would give me intellisense back.
The problem ended up being the target framework. The project was referencing .NET 4 Client Profile, whereas the project it was referencing was just .NET 4. Apparently this difference is subtle enough to trip up visual studio in the confusing way described above.
So take a look at your project's target framework, maybe you'll get lucky.
Definitely check your Inherits or CodeFile. I've had this happen before where I had them pointing at the wrong files.

Resources