|
I have an application which is using an image which is picked up from a resource file.
i have this exception-
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"WindowAplication1.Properties.Resources.resources\" was correctly embedded or linked into assembly \"WindowApplication1\" at compile time, or that all the satellite assemblies required are loadable and fully signed."}
How can I handle this???
Thanks in adv...
|
|
|
|
|
The clues are in the question:
1) Make sure "WindowAplication1.Properties.Resources.resources" was correctly embedded or linked into assembly "WindowApplication1" at compile time
2) All the satellite assemblies required are loadable and fully signed.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Dear All --
Forgive me if I am being greedy. Upon writing a function header say "Private void FntName()" is there a way the two curly braces and the try catch block is automatically inserted.
cheers
|
|
|
|
|
If you're using VS I guess this could be done by creating code snippets.
|
|
|
|
|
Calla --
Yup I am using VS 2005. But I want it automated. How will I trigger it ?
cheers
|
|
|
|
|
You may wish to ask yourself why you want to insert a try-catch into every method you are creating. That is no way to trap errors properly. It will just make the entire application nearly impossible to effectively debug the application.
If you do wish to do it, look up on how to creating studio add-ins. You may want to tie in that way to automate the process with no user intervention(i.e. keystrokes), but the logical way would be to create a snippet, and assign a keystroke to it so that you only have to type that to get the whole block inserted.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I'm with PogoboyKramer on this - try catch round each and every method just look like you are saying "I don't know what I am doing, so I'll try and ignore as many problems as I can instead of fixing the problems behind them"
Smacks to me of VB's "On Error Resume Next"
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: On Error Resume Next
Goto Happyland
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
PogoboyKramer wrote: Goto VeryUnHappyland if you are the poor sod maintaining it...
FTFY!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Reading between the lines... You've worked with BA's before
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Who hasn't?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
If you like removing said Try/Catch blocks all the time, this would be a good idea. But, it's a horrible idea to put a try/catch block in every method. You're not really doing/handling exceptions properly if this is the case, but instead making a nightmare of debugging your app.
|
|
|
|
|
Dave --
Tell me one instance where you wouldn't prefer placing a try/catch in a method.
cheers
|
|
|
|
|
thomforum wrote: Tell me one instance where you wouldn't prefer placing a try/catch in a method.
Two instances. There are many others.
public int Count
{
get { return count; }
set
{
if (value >= 0)
count = value;
}
}
private int count;
public void Initialize(String name)
{
if (String.IsNullOrEmpty(name))
throw new ArgumentException("Name must be defined");
this.name = name;
}
I also do not want to see the following. The following might require try/catch somewhere but logging the exception twice does nothing but provide confusion. So the question becomes what does the one try/catch do that the other does not?
private void ProcessTxn()
{
try
{
...
}
catch(Exception e)
{
__log.Error("Failed to process txn", e);
throw;
}
}
public void Process()
{
try
{
PrepareTxn();
ProcessTxn();
SaveTxn();
}
catch(Exception e)
{
__log.Error("Failed to process", e);
throw;
}
}
|
|
|
|
|
I think the discussion isn't about the inherent value of a try-catch block. It is the problems associated with simply making an exception go away with no logging or anything in an empty try catch.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
You should only use a try/catch if you plan to do something with the exception. Exception handling is intended to provide a defense mechanism, where you can actually handle the exception - what's the point of just consuming it? If you just catch the exception then you don't know that part of your code encountered a problem, so you end up masking problems from a user. As an example, what happens if you have a network connection open and connectivity is lost? If you are writing to the network stream, it's a good idea to know that it's closed unexpectedly during a stream write, so you can inform the user that the write didn't complete successfully.
thomforum wrote: Tell me one instance where you wouldn't prefer placing a try/catch in a method.
This, effectively, is blind optimism. Use exception handling for what it's intended for.
|
|
|
|
|
When I want the exception to bubble up to a higher level to be handled at a business process level where I can centralize problem logging and abort whatever transaction is going on at the time, which is most of the time.
Doing it your way would limit the exception to that function, where you'd have to throw a new exception to get it to go higher.
But, don't take my word for it. There's tons of articles on the subject: Google Results[^]
|
|
|
|
|
You'd want to handle the ThreadException [^].
If you want to swallow exceptions, do it there - after logging them or something like that. There's an example on the page on setting up basic exception-handling.
I are Troll
|
|
|
|
|
Yes. See this[^] code snippet.
/ravi
|
|
|
|
|
to add try catch block u type try and give two tab entry using key board u will get the try catch block automaticly
|
|
|
|
|
Hi All,
I have a created Custom Culture Info using CultureAndRegionInfoBuilder.in C#
Now I want to edit some of the properties of that created Custom Culture.
Any body has any idea, How to do this?
Regards,
Sunil G.
|
|
|
|
|
Hi, One of my client is providing FTP Acess over VPN Connection.
Whenever i try to use FtpWebRequest object.GetResponse().GetResponseStream() throws error message "fil not found,no acess,..."something like that.
I found the "Proxy" property is available for FtpWebRequest object.
can anyone help how to use this Proxy property or is there any other way to connect FTP to list a file using c#.
Thanks & Regards
Madhi
|
|
|
|
|
Message Closed
modified 23-Nov-14 5:51am.
|
|
|
|
|
If so, whether I need to connect through c# or CISCO VPN client software.
if i connect through CISCO VPN client software it shows connectionEntry:"SMARTMD VPN MPARTNER",
HostName:"XXX:XXX:XX:XX",
Transport:IPSEC/UDP
how can i obtain the ip address, and whether i need to send the Credential property of FTPWebRequest?
|
|
|
|
|
hi! friends,
I am using modalpopextender to display the data.
my modalpopextender is open on Linkbutton click.
i have a multiple linkbutton in datagrid.
My query is:
i want to display the record from the database in Label which is placed on modalpopextender.
i already retrieve the data from the database but, I don't know how to put these information in Label
Actually the linkbutton is not shown on my ascx page because
some internal coding. so i can't generate click event.
Please guide me: I display my some code for your help,:
<asp:LinkButton ID="lbtnID" runat="server" Text='<%# Eval("ApplicantId")%>' CommandArgument='<%# Eval("ApplicantId")%>' CommandName="Det"></asp:LinkButton>
<asp:Panel ID="pnltest" runat="server" >
<table>
<tr>
<td >Applicant Name</td>
<td ><asp:Label ID="lblAppName" runat="server"></asp:Label></td>
</tr>
<tr>
<td >Applicant Code</td>
<td ><asp:Label ID="lblCode" runat="server"></asp:Label></td>
</tr>
</asp:Panel>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lbtnID" PopupControlID="pnltest" RepositionMode="RepositionOnWindowResizeAndScroll">
</cc1:ModalPopupExtender>
thanx and regards
modified on Thursday, October 28, 2010 6:18 AM
|
|
|
|