How to find specific implicit conversion in VS2013? [duplicate] - vb.net

When building an application in Visual Studio. It shows the following error when exceeding the error count
fatal error C1003: error count exceeds 100; stopping compilation
Is there a way to increase the error limit?

This limitation is hardcoded. Here is the post from the MSFT employee in the microsoft.public.vsnet.general group dated 2006 (look for 'Fatal Error C1003'):
Hi,
Unfortunately this 100 limitation is
hard coded and cannot be changed. It's
just inpractical to keep all errors
information around since one error may
cause other several errors.
I hope you understand the rational
behind this design by our product
team. However, if you still have
concerns about this, please feel free
to submit your feedback at
http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220
which is monitored by our product
team. Thank you for your
understanding.
Sincerely, Walter Wang
(waw...#online.microsoft.com, remove
'online.') Microsoft Online Community
Support"

I don't think so. VS basically reports all errors it encounters during compilations. There might be some erroneous parts of the code that make the compiler getting caught in an infinite "error" loop.
The limit was implemented to avoid that. In most cases the 100 errors you get are just the same error reported over and over again. What would be the sense in increasing the number of repetitions?
Maybe you can post the code snippet where the error occurs first, so we can help you fix it.

I believe that it is a hard-coded limit, so no.
As others have commented, it's difficult to understand what you want to achieve by this.
At the end of the day, you'll have to fix them all, so get stuck in and start fixing them. Eventually, you'll get below 100, and you can start counting them.
It is not normally valuable to report the actual number of errors when this occurs. Most of the time, when you get C1003, it's actually only a few real errors, leading to a massive chain of other errors.
(e.g.)
If there is an error in a .h file, that error will be reported in every .cpp file that #includes it.
If there is an error that prevents any kind of identifier being defined (e.g. a class, variable, method name), then every time you try to use it later on, an error will be reported.

Workaround to reduce number of reported errors:
rename cl.exe to cl-orig.exe
roll your own cl.exe that launches cl-orig.exe, capturing its stdout / stderr
parse stderr, looking for error messages and counting them
breaks after first n errors
See http://msdn.microsoft.com/en-us/library/ms682499(v=vs.85).aspx for some hints.

I also have a project like this: sometimes Visual Studio decides there is a lot to do, emits 100 really irrelevant messages about other parts of the solution and aborts the build because it reached the message limit without working on the project I'm interested on.
The workaround we have found is to use msbuild to build the solution from a command prompt: the Use MSBuild walkthrough outlines the steps. msbuild outputs all messages to the console and once the build completes we can work and debug again in Visual Studio. Not ideal, but it lets us complete the task at hand.

Related

Encountered Strange Error: " & ErrorName

New to VisualStudio 2015, but not to programming. Have searched both Google and here for a lead on this, but considering the available search terms, I might not immediately uncover them.
I was looking into porting an old VB6 (200k+ LoC) to VB.Net in VS2015. Mostly just poking around to determine viability. Using a project converter, and have resolved most of the initial errors, and am familiar with how the Error List works.
However, it is throwing a new one at me. It now only has two lines of error, both showing the same thing. They both say:
" & ErrorName
That's a Quote, Ampersand, and ErrorName. That's all that show up on the error list line. No file. No line number. Double click on them does nothing.
I thought perhaps the project was corrupted, so I completely re-created it, adding all the modules, forms, classes, etc again, and it found a lot more errors to fix, which I fixed, and now these two lines show up again.
Does anyone have any indication where this is coming from, or, better yet, how to fix?
I've seen VB programmers report this misbehavior before, never with a good lead to explain the problem. It is specific to VS2015, the Roslyn integration caused many issues. In general a very buggy release, be sure to apply all available Updates, currently up to Update 3. If you have a license that includes an MSDN subscription then I recommend you install VS2012, the last "good" version of VS that was not yet affected by Microsoft's new focus on agile development.
I think the underlying issue is caused by the IDE simply not parsing the compiler error message correctly. Probably having to do with the statement with the error getting quoted in the message. Getting only part of the statement text and it fumbling quotes is a pretty good hint that this is where it went wrong.
So look at the actual output of the compiler, decent odds you'll now see the full error text. Use Tools > Options > Project and Solutions > Build and Run. Change the "MSBuild output build output verbosity" setting to Normal. After the failed build, use View > Output to see the compiler output. You'll probably have a lot of messages, consider copy/pasting the content.

All errors shown by the compiler (Maximum number of errors has been exceeded)

We've been asked to migrate a project from vb6 to vb.net. We used the conversion wizard from visual studio 2008 and as we expected lots of errors came along.
I know that there is a hardcoded limit of errors shown by the compiler (100 i guess).
But we're on a tight schedule and we'd need all the errors so we could give an estimate on how much time we'd take for this project to be converted.
One option would be fixing the errors that we have now. But there's a high probability that more errors would be generated and as i said, we have to give an estimate as soon as possible...
Is there a way for me to get a list of all errors?
Unfortunately there is no way to get all of the errors that would be generated by the compilation. As you noted the error limit is a hard coded value in the compiler. Once that limit is reached the compiler will cease emitting error messages.
Even if you could get all of the error messages I would say it's not the best way to judge the amount of time it will take you to port from VB6 to VB.Net. They are very different environments (VB6 being essentially an STA COM environment while VB.Net is just another CLR language) and these differences can manifest in unexpected ways. The number of errors will give you an estimate of how long it will take to compile but not how long until the app is actually working again

Getting erroneous "Maximum number of warnings has been exceeded"

I inherited a VB.Net solution (VS2005) that I've just cleaned up.
I've gotten a clean build except for this warning:
Warning 1 Maximum number of warnings has been exceeded.
I could understand the first error if I actually had 100 warnings, but I don't. I'm a stickler for clean builds. Any ideas why I'd still be getting this message?
Maybe You Have Unloaded file in your Project
if you work in team and use source control like TFS make sure other developer checking in all file like entity model and etc..
if your problem does not solve after this step remove all file in "Temporary ASP.NET files" and close your visual studio
last way for resolve this error is changing target framework in solution and then Return it to previous state
I hope your problem will be resolved after this steps :)

How can I find total number of warnings in project?

I've just converted a project from .net 1.1 to 3.5, and I'm being given loads of warnings in the error list.
The program compiles and runs ok, but I think I should probably try to at least reduce this large number of warnings.
The trouble is that the error list only tells me about the first 102 warnings. Even when I fix one, the number stays at 102. So I have absolutely no idea how many warnings there actually are.
If there are 150, I'd like to get rid of them. But if there are 10,000, I don't have the time to fix them all.
Is there a way to see the actual total number of warnings?
Was already answered here on the board:
Is there a way to show ALL the compiler warnings in Visual Studio 2010?
I had the same Problem.. i can only suggest to outcomment large blocks and enable them step by step. So you have a quick overview on the real number of Warnings
Though this information relates to the error messages, I think it holds true for the warnings also. The answer seems to be: NO.
It was "no" in 2006 and it is still true for VS 2010:
Provide configurable maximum error messages limit for VB.Net compiler
Thanks for the feedback on this issue. We agree that this is something that we would like to improve as we get this feedback a lot from customers who are upgrading their projects or trying to configure them on a new machine. We actually performed some experiments where we did this but it made the performance of the IDE too slow because of the overhead of tracking all of the errors. I'm resolving this issue as "Won't Fix" for now but we will likely revisit this in a future version of Visual Studio.

internal error markers

Theoretically, the end user should never see internal errors. But in practice, theory and practice differ. So the question is what to show the end user. Now, for the totally non-technical user, you want to show as little as possible ("click here to submit a bug report" kind of things), but for more advanced users, they will want to know if there is a work around, if it's been known for a while, etc. So you want to include some sort of info about what's wrong as well.
The classic way to do this is either an assert with a filename:line-number or a stack trace with the same. Now this is good for the developer because it points him right at the problem; however it has some significant downsides for the user, particularly that it's very cryptic (e.g. unfriendly) and code changes change the error message (Googling for the error only works for this version).
I have a program that I'm planning on writing where I want to address these issues. What I want is a way to attach a unique identity to every assert in such a way that editing the code around the assert won't alter it. (For example, if I cut/paste it to another file, I want the same information to be displayed) Any ideas?
One tack I'm thinking of is to have an enumeration for the errors, but how to make sure that they are never used in more than one place?
(Note: For this question, I'm only looking at errors that are caused by coding errors. Not things that could legitimately happen like bad input. OTOH those errors may be of some interest to the community at large.)
(Note 2: The program in question would be a command line app running on the user's system. But again, that's just my situation.)
(Note 3: the target language is D and I'm very willing to dive into meta-programming. Answers for other languages more than welcome!)
(note 4: I explicitly want to NOT use actual code locations but rather some kind of symbolic names for the errors. This is because if code is altered in practically any way, code locations change.)
Interesting question. A solution I have used several times is this: If it's a fatal error (non-fatal errors should give the user a chance to correct the input, for example), we generate a file with a lot of relevant information: The request variables, headers, internal configuration information and a full backtrace for later debugging. We store this in a file with a generated unique filename (and with the time as a prefix).
For the user, we present a page which explains that an unrecoverable error has occurred, and ask that they include the filename as a reference if they would like to report the bug. A lot easier to debug with all this information from the context of the offending request.
In PHP the debug_backtrace() function is very useful for this. I'm sure there's an equivalent for your platform.
Also remember to send relevant http headers: Probably: HTTP/1.1 500 Internal Server Error
Given a sensible format of the error report file, it's also possible to analyze the errors that users have not reported.
Write a script to grep your entire source tree for uses of these error codes, and then complain if there are duplicates. Run that script as part of your unit tests.
I know nothing about your target language, but this is an interesting question that I have given some thought to and I wanted to add my two cents.
My feeling has always been that messages for hard errors and internal errors should be as useful as possible for the developer to identify the problem & fix it quickly. Most users won't even look at this error message, but the highly sophisticated end users (tech support people perhaps) will often get a pretty good idea what the problem is and even come up with novel workarounds by looking at highly detailed error messages. The key is to make those error messages detailed without being cryptic, and this is more an art than a science.
An example from a Windows program that uses an out-of-proc COM server. If the main program tries to instantiate an object from the COM server and fails with the error message:
"WARNING: Unable to Instantiate
UtilityObject: Error 'Class Not
Registered' in 'CoCreateInstance'"
99% of users will see this and think it is written in Greek. A tech support person may quickly realize that they need ro re-register the COM server. And the developer will know exactly what went wrong.
In order to associate some contextual information with the assertion, in my C++ code I will often use a simple string with the name of the method, or something else that makes it clear where the error occured (I apologize for answering in a language you didn't ask about):
int someFunction()
{
static const std::string loc = "someFunction";
: :
if( somethingWentWrong )
{
WarningMessage(loc.c_str(), "Unable to Instantiate UtilityObject: Error 'Class Not
Registered' in 'CoCreateInstance);
}
}
...which generates:
WARNING [someFunction] : Unable to
Instantiate UtilityObject: Error
'Class Not Registered' in
'CoCreateInstance