|
Thank you Rojer for the comments.
I have full access to the host server (it is commercial) but the problem is that the time out occurs here and there. That is, it occurs, for instance, at stored procedure 1 now and then another time it runs the SP1 well and then occurs at SP2.
How can I be sure that the problem is from the host server? As I have to prove that to my boss
|
|
|
|
|
Beats me! Can you access the SQL Server logs on the server? Are you opening connections in your app but failing to close them as soon as you're done with an action? SQL Server is a resource hog, and it's critical to clean up after yourself often. Without a lot more information, this is an impossible problem to solve form a distance. Good luck!
Unfortunately, the universal law, "All things are simple for the one who doesn't have to do them" applies, and "I dunno" isn't going to convince the boss.
Will Rogers never met me.
|
|
|
|
|
I want to be able to debug a C# 2010 web form application that runs using the local iis server. I have my breakpoints set in the application, but the code never stops at those breakpoints. ( I want to do this type of debugging since the application is going to run under iis on a test server and then in production.)
When I run the web form 2010 application using cassini in the debug mode, all the break points are hit and the code runs with no problems.
Thus can you tell me what I need to do to be able to debug my web form app 2010 using the local iis server so that I can hit the breakpoints I have set to see what is wrong with the application?
|
|
|
|
|
You have to attach the debugger to the instance of
aspnet_wp.exe that is running.
Open the site in IE as normal and set all of your breakpoints and then, from the main menu, select 'Debug', 'Attach to Process'. Select 'aspnet_wp.exe' form the list and click the 'Attach' button at the bottom right of the dialog.
Navigate to the page you wish to debug and your breakpoints should start to get hit.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
How can I 'Open the site in IE as normal' normal? I run the code in cassini in the visual studio 2010 ide and hit f5.
|
|
|
|
|
Publish your website on IIS in ASP.NET page: http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
1. webvidu asp.net to run in normal mode and programming Publish normal website
2. Publish test their IIS under ASP.NET on IIS website, follow the instructions above also normal
3. When put up IIS and web browser they type in localhost/asp shall be the following error:
XML Parsing Error: not well-formed
Location: http:
Line Number 1, Column 2:<%@ page theme="Default" language="C#" masterpagefile="~/MasterPage/MasterPage.master" autoeventwireup="true" inherits="webvidu._Default, App_Web_default.aspx.cdcab7d2" %>
-^
I do WinXPSP2 IIS on the operating system, and use vs.net2005 13.0.1 firefox browser
so please fix this bug? thanks
|
|
|
|
|
One possible reason: Check if correct .NET Framework is selected in IIS. For example, it might be set as v1.1 right now but v2.0 is needed.
|
|
|
|
|
I do not think NetFramework because my web host is the same machine.
|
|
|
|
|
So what? In your IIS you might have forgot to set the correct Framework version. Please check.
|
|
|
|
|
I've modified the above error, machine error follows:
Server Error in '/asp' Application.
Failed to access IIS metabase.
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.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492170
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385679
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
|
|
|
|
|
|
Hi,
when I start debuge a web solution, this message appear,even if solution was a empty web form,
what should I do...?
I use visual studio 2010 & windows 7.
modified 25-Jun-12 11:57am.
|
|
|
|
|
|
Thanks for guides... I read that, but that's not helpful…
Actually I reinstall windows at last, and before installing VS, I install IIS by all categories.
That's worked.
|
|
|
|
|
In a C# 2010 web form that uses a formview control, I am comparing 2 dictionary objects to see if their values are different, right before the actual change occurs in the database. The code is comparing the old dictionary value to the new dictionary value to see if the value has changed. If so an 'invalid' date field is being set.
However the problem is the values are actually the same. By stepping through the code, the application thinks the values are different. Can you tell me what is wrong with the code listed below:
protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
if (e.NewValues["Cutoff_Date"] != e.OldValues["Cutoff_Date"])
{
e.NewValues["Invalid_Date"] = "Y";
}
}
|
|
|
|
|
First thing you should check is the whether formview is getting databound on each postback or only one first postback . because if it is getting databound on each postback then you will have to make it do that only on first load and not on each postback .
If that doesn't work then, My suggestion is that you handle the ItemDataBound event too. get the value in this event and save it somewhere (like session variable). then in this event get the new value and compare it with the one in in session variable.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
When comparing text, you have to do a compare against the actual values of the text, and not the string representations held in e.NewValues and e.OldValues. That type of comparision is good for numbers, or short text such as "GOOD" or "BAD"
So text is really stored as a byte array like 37 80 68 70 45 49
Doing a String.Compare will examine the byte array of the strings, and give you an accurate result.
In your case, I don't what the values are, but NewValue != OldValue will not produce a consistent result.
If String.Compare(path, 0, "file:", 0, 5, True) = 0 Then
Return True
Else
Return False
End If
classy_dog wrote: However the problem is the values are actually the same. By stepping through the code, the application thinks the values are different.
You lost me here. You know the values are a match, but stepping through the code shows you different values.
I going to go with an inaccurate result being produced by your comparison
|
|
|
|
|
classy_dog wrote: By stepping through the code, the application thinks the values are different.
That's because you are comparing the values of the objects and not their content. You need to do a String.Compare() [^] to compare the string data; the == and != operators will merely tell you whether the two references point to the same or different objects.
[edit]
Well I was wrong as, according to MSDN[^] strings are a special case. I can only conclude that the dictionary is not returning string s in the sample you showed.
[/edit]
|
|
|
|
|
I knew you had to do a string.compare, and some of the details of it, but didn't think of his code as comparing objects, and not the actual value.
Nice Answer!, I even learned from it.
|
|
|
|
|
According to this[^] it looks like I was wrong. Time for a big slice of crow pie, followed by some C# testing.
[edit]
I suspect the dictionary that OP is using, does not return pure strings in the sample shown.
[/edit]
|
|
|
|
|
We got a little debate going on here in this rodeo cowboy
I read the reference you pointed to, and I must support your first argument regarding comparison operators and objects
Operator B for string b = string.Copy(a) returns false, but a and c returns true
string a = "hello";
string b = String.Copy(a);
string c = "hello";
Console.WriteLine(a == b);
Console.WriteLine((object)a == (object)b);
Console.WriteLine((object)a == (object)c);
Anwsers:
True
False
True
[edit]
The op took a shortcut by using an operator against the objects, and failed to create 2 new buffers to store the actual values he needs to string compare.
I threw a little c++ lingo in there.
|
|
|
|
|
Casting the string s to object s means that the == operator will compare their addresses to see if they point to the same object (same as comparing two pointers in C++). As I said, I suspect that the dictionary indexing operations do not return 'pure' strings.
|
|
|
|
|
Oh! OK, I understand now. pure strings
|
|
|
|
|
|
I forgot to mention,
After working in c++ using the strcmp macro, and walking through it a hundred times, I get a pretty good idea of how it works, how the strings are actually compared down to the byte value for an exact match.
But in the case of asp.net whether it's vb or c#, I assume the string.compare uses a similar method of comparison down low underneath. I suppose one could write something similar using bytes in vb or c#.
I've never been able to walk through an operator, to see what it really does.
But I think your right about the OP just compared object pointers, and got a match.
|
|
|
|