Twitter Bootstrap (MVC 4 package) on App Harbour - c#

I've just uploaded a sample twitter bootstrap app to app harbor using the sample mvc 4 nuget package and am getting the following javascript error when clicking on any of the buttons at the top of the sample landing page:
Uncaught SyntaxError: Unexpected token *
Everything works fine locally and I've checked that all the files I've got locally are in my bitbucket repo.
All files are being request and and returned correctly with statuses of 200.
I have tried this in chrome and IE. Same problem.
Anyone got any ideas why this might be happening on APPHB but not locally?

Ok, I found the answer to this problem. The outline of the issue can be found on:
http://bugs.jquery.com/ticket/13274
It's to do with how the minifier deals with //# sourceMappingURL=jquery.min.map
These "comments" are useful for debugging minified js files as they give you a link back to the unminified version but they seem to cause a problem with the minifier.
You've got two option to solve this. Either remove the lines completely. Or escape them with block comments like:
/*
//# sourceMappingURL=jquery.min.map
*/
Instead of the default:
//# sourceMappingURL=jquery.min.map

Related

Recovering URL don't return expected result

I'm working on .Net App in C# and I have problem,after I got latest version from Source Control my application can't start. After Debugging I found that these lines:
HttpApplication app = (HttpApplication)source;
var requestedResourceAbsoluteUrl = app.Request.Url.AbsolutePath.ToLower();
return not the Default.aspx page, but only Default(with missing .aspx in the end). I tried everything. Mapped again the solution. Tried in different browsers, repaired Visual Studio. I used Fiddler to detect the request. This is about every page in the application. Everything is OK with my coworkers project wich checkined this version
I'm posting the solution: I deleted all history, cookies, cache and other data in the browsers and now everything seems fine. It keeps not working in IE.

SSO MVC App compiles without errors but throws 404

I have a very basic Single Sign On app built on VS 2015 using MVC and Web Forms. It is supposed to be a simple proof of concept and is based on some code found here and here which are essentially the same things. I've finally gotten it all converted to use .Net 4.5 but when running it on my local server it throws a 404 with no debug information.
The 404 itself wasn't initially a surprise as I was supposed to be able to change the url to one of the secure pages (for instance /WebSecApp1) which would redirect me back to the signon page but no matter what I put as the url I get the 404.
I've also tried changing the urls in the code so that they contain the port numbers for the localhost but that doesn't work either.
It was suggested to me that the RouteConfig.cs could be the culprit but I don't see how that could be since I'm calling a single page with no parameters.
I know this is kind of lite on details but does anyone have any suggestions?
Yes this looks like a routing issue as you also thought it to be. Routing is essential for web api too .Pls see https://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-and-action-selection. Does your api request look like this
GET http://localhost:34701/api/products/1?version=1.5&details=1
You do have to mention the port in the request.
While the routing that Arathy mentioned above was partially to blame, the real problem turned out to be relatively simple. In my case simply selecting Properties->Web for each of offending pages and setting "Override application root URL" to checked fixed the whole problem.

TinyMCE control not showing in Umbraco (Chrome only)

The TinyMCE control for RichTextEditor properties in the Umbraco back-office do not show in Chrome, but are visible in other browsers. The text editor box is just missing entirely.
The Chrome console shows the error
SyntaxError: Unexpected token <
on the page tinymceCompress.aspx
Looking into the source of this file in Chrome Dev Tools, the HTML output for an ASP.NET error page is being appended to the end of the file. The error is:
Server cannot append header after HTTP headers have been sent.
I have manually read the reponse to the tinymceCompress.aspx in Fiddler for both Chrome (not working) and IE (working), and the reponse is exactly the same. There is no ASP.NET error message appended to the bottom of either response.
The control used to show in all browers, it is only recently that it appears to have broken. To our knowledge, we have not modified the Umbraco install.
This is Umbraco 4.11.9.
If you haven't found the answer yet, try looking in the Tiny MCE javascript files. I recall a while ago running into a file which was in the Umbraco release which had a misplaced SCM merge snippet (looks something like <<<). I think it may have been a similar issue.
EDIT: To add to this, you may be able to do a text search across all the scripts that are loaded and look for something like this:
<<<<<<< HEAD
or
>>>>>>> branch_name (as an example)
I had same issue in upgrading Umbraco v4.5.2 to v4.11.9. If you upgrade it from v4.5.2 to v4.11.10 the issue won't happen in Chrome any more.

Install Profile Service - Profile Installation Failed (Get UDID from iOS)

So I followed this tutorial on how to get the UDID from a iOS device using ASP.NET and C#. I got the .mobileconfig working and it loads up on the iPad. My problem is now though, that when ever I hit "Install" (See picture below) it gives me the error "Profile Installation Failed" - "Invalid Profile".
I can see the iPad visits my page and gives me the UDID, but I can't seem to find a page that shows me what the iPad wants back.
Right now i'm just returning some xml, but that doesn't work:
<plist version="1.0">
<key>status</key>
<string>OK</string>
</plist>
Here is the .mobileconfig im using
After searching high and low I found this comment by Lakitu which said to do a 301 redirect.
If anyone is interested here is the code I used for redirecting:
context.Response.Status = "301 Moved Permanently";
context.Response.AddHeader("Location", "/device/enroll.aspx");
context.Response.End();
I read that you needed to redirect to a directory, but any file seems fine.
Happy coding!

Google-drive example: oauth2callback not found

I need a little help with the C# example program of Google-Drive...
I used this so-called "tutorial"/"example":
https://developers.google.com/drive/examples/dotnet
And the code from here:
https://code.google.com/p/google-drive-sdk-samples/source/checkout
I uploaded my (only slightly modified) sourcecode here in case anybody doesn't have Mercurial (I didn't have Mercurial and no admin rights to install it either, and Mercurial is the only way to get the sourcecode...):
http://verzend.be/elt0k13enraw/DrEdit.rar.html
I always get
"Ressource cannot be found"
Requested URL: /oauth2callback
I don't find this astonishing, as no oauth2callback controller or handler is implemented...
I tried adding a Controller called oauth2callbackController and redirecting to another action in oauth2callbackController.Index, doing
return new RedirectResult("/about/about");
But that only creates a NULL-reference exception.
So i figured, maybe the wrong controller and redirected to
return new RedirectResult("/drive/Index");
But that only creates an infinite loop of redirect -> allow -> redirect - allow -> etc.
BTW, the config to change the API key + REDIRECT_URI is in
Models\ClientCredentials.cs
Note:
The problem aren't my modifications.
The sample also didn't work unmodified, with the exact same error.
All I did was removing EntityFramwork references, and throwing "Not implemented exception" when a method using entity was called.
Edit:
Additional information:
What I really wanted to do in the first place is to write a console service that exports my database, LZMA-compresses the exported content, encrypts that with OpenPGP, and uploads the database of my server to Google drive every day at 24:00 o'clock, without any user input.
I got export working without a problem, i got the LZMA compression working without a problem, I got the encryption with PGP working without a problem.
After the end of the working day (grrrr), when I was at home, I was even able to download the example-code with the mercurial installed on my Linux-machine at home, and bring it on the windows machine using SMB...
But now I can't get the sample for the Google-drive SDK working...
And moreover, what I really need is an example for a console service/daemon, not a web-application.
When I created the API key, I saw one could create a key for a service, but there is no example on how to write a Google-Drive service (console application), and no useful documentation as well (yea there is a reference, but it's only a reference, IntelliSense provides about the same)...
When configuring your app in the API Access tab of the APIs Console, you had to set the root (/) of your web server as the redirect URI and not /oauth2callback.
Assuming that your app is published at www.example.com, just go back to the APIs Console and set it to www.example.com instead of www.example.com/oauth2callback

Categories

Resources