[ASP] Fix "Debugger not working - Authentication error occurred..."
Coding... coding... and press F5 to debug it...The message show: "Debugger not working - Authentication error occurred while communicating with the web server" and you can't continue your work!
Some error similar
"Unable to start debugging on the web server. An authentication error occurred while communicating with the web server"
"Error while trying to run project. Unable to start debugging on the web server."
What problems?
Try check some one:
1. Are you register asp.net to IIS?
- Delete the ASPNET account
- Using commad line go to ASP.NET IIS Registration Tool and type "aspnet_regiis -i"
Read more at: http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx
2. If you using old system: IIS6, Visual Studio 2008,...
Please read this article: http://support.microsoft.com/kb/896861
[Hosting] SNAPP - Try free cloud hosting platform-as-a-service for .NET applications
This host had closed!
I feel enjoy when I try this cloud. Now it free for Beta
1. .NET PaaSified
Snapp Systems is an elastic cloud hosting platform-as-a-service for .NET applications. It's the first PaaS to include a configurablestaging and production site. DevOps just became more productive.
2. How it work
1 Deployment
Deploy your application using FTP, Web Deploy, GIT, or TFS. No deployment learning curve.2 Staging Site
Meet the first PaaS that includes a full staging site so you can test your app before it goes live in production.3 Publish
No need to redeploy. With a click of a button, publish your staging site to production - immediately or schedule the deployment in the future. We also support deployment hooks too.4 Production Site
We provide an elastic scalable production site that you expect in a PaaS. Increase the number of workers when you need to. Now with Hostname support.5 Application Snapshot
Publish with peace of mind. When you publish your app to production, we keep an archive of your latest releases.6 Rollback
Should something unforeseen happen in production, rolling back to a previous working snapshot is just a click away.7 Application Monitoring
Our PaaS comes with exception management tools. Enable this feature and monitor your application exceptions.8 Reports
View exception handler reports and get more insight to troubleshoot your app.
3. Review SNAPP cloud
SNAPP provide .Net flatform and free MS SQL Server
And chart:
Ping from Buffalo
You can using SNAPP beta for testing.
[Javascript] Make This Site Your Home Page Button
1. Set homepage only for IE
Make this site your <a href="javascript:history.go(0)" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://aspnet-fix.blogspot.com/');">Home Page</a>Test: Make this site your Home Page
2. Set homepage for FireFox
If config: signed.applets.codebase_principal_support = true
<script language="javascript"> function setHomepage() { if (document.all) { document.body.style.behavior='url(#default#homepage)'; document.body.setHomePage('http://aspnet-fix.blogspot.com/'); } else if (window.sidebar) { if(window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch(e) { alert("this action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true"); } } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage','http://aspnet-fix.blogspot.com/'); } } </script>Test: Home Page
3. How about Chrome?
Chrome not allow to set homepage by javascript!
4. Using bookmark
// Add to Bookmark function add_bookmark( a ) { title = document.title; url = document.location; try { // IE window.external.AddFavorite( url, title ); } catch (e) { try { // Mozilla Firefox window.sidebar.addPanel( title, url, "" ); } catch (e) { // Opera if( typeof( opera ) == "object" ) { a.rel = "sidebar"; a.title = title; a.url = url; return true; } else { // Unknown (Chrome, Safari,...) alert( 'Press Ctrl-D to add page to your bookmarks' ); } } } return false; }
<a href="#" onclick="return add_bookmark(this);">Add to bookmarks</a>Test Add to bookmarks
P/S: Today users don't like set your website to home page, because search engine and many bookmark services
[C#] Remove all special character \ /:*?"<>|!@#$%^&() from a string
You want to remove characters \ /:*?"<>|!@#$%^&() from a string?Very easy! Follow some method:
1. Remove all special characters
string rExp = "[^\w\d]"; string tmp = Regex.Replace(n, rExp, "");
2. Remove all special characters but allow some
Example: Allow . and _
Regex.Replace(input, "[^a-zA-Z0-9._]", string.Empty)
3. Easy function remove all special characters, but allow "_"
public static string Remove_Special_Characters(string str) { StringBuilder sb = new StringBuilder(); foreach (char c in str) { if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') { sb.Append(c); } } return sb.ToString(); }
Fix error: "Could not load file or assembly 'Microsoft.Web.Extensions..."
One day, you are coding... And run it! But an error show!Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.You don\'t worry! And try some solutions
1. Review web.config
- Install the latest Asp.NET Ajax - Open my web.config in my production server and replace this line
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"></add>
by
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"></add>PublicKeyToken is in capitals....
2. Check your bin folder
Copy the System.Web.Extensions.dll into the app's bin directory if you have.
3. Install ASP.NET AJAX 1.0
Check you had install it? If not, you download it at ASP.NET AJAX 1.0
4. If you using Ajaxcontrol toolkit
Download and install it at Ajaxcontrol toolkit
Try one solution or try all until you resolve an error!
[C#] How to fix "object reference not set to an instance of an object"
Oh! No...When you coding with .Net. Many time you meet an error: "object reference not set to an instance of an object".
What happen???
Example 1: Convert null to int
string query = "Select * from USERS where ID = '" + txtUID.Text + "'"; SqlCommand cmd = new SqlCommand(query , CN); int count = (int)cmd.ExecuteScalar();//Error hereWhat problem? ExecuteScalar return to null when record not found in database. In case, you can using Convert class
Convert.ToInt32(cmd.ExecuteScalar());//It will return 0 when ExecuteScalar() return nullExample 2: Try get object properties when this object is null
var str= null; if(str!="")// Error here { //do some thing }Resolve the problem: You can try
var str= null; if(str !=null && str!="")// Error here { //do some thing }Or try this
var str= null; if(!String.IsNullOrEmpty(str))// Error here { //do some thing }Example: Very much error!
// About 10000 linesResole all with
try{ //All code here } catch (NullReferenceException ex) { ShowMessageBox("Error" + ex.Message); }
Subscribe to:
Posts
(
Atom
)
No comments :
Post a Comment