VS2013 Express not Compiling as normal - visual-studio-2013

Just having an annoying issue with VS not compiling correctly and showing a bogus compile error.
Error 1 'ConcurUtility' is not declared. It may be inaccessible due to its protection level. <path>\App_Code\AppUtility.vb 22 34 KWAI
Error 2 'T' is not a member of 'System.Text.StringBuilder'. <path>\App_Code\AppUtility.vb 30 16 KWAI
It says my class is not declared when it clearly is as it comes up in intelli-sense. It is declared public and my method I am calling is
Pubic Shared Function GetDocument(...
I have commented out my call to the function and it does compile then so it cannot be the ConcurUtility class that is causing the issue.
I have rebooted my machine and it is still not working. I have cleaned and tried to rebuild but to no avail. Any ideas what is causing this problem.

You should troubleshoot your second error instead. I guess ConcurUtility was not public in the last successful build, and VS is still considering it as protected/internal based on that.

I believe the Project File must have been corrupt (who knows) as I started from scratch and added every class in manually then copied and pasted my code from my old project to the new one and it works fine. Just one of those things that perhaps the express version must have a unknown bug because it is hard to reproduce. I.e. the clean does not really do a thorough clean.
The only thing I can recall is I created the class under a different name and renamed the call before renaming the class and file and somehow this has been cached and so it no longer complies. Not worth my effort figuring it out. Tis one of those unsolved mysteries.

Related

How to fix fatal error Fatal error: Class CI_Session_files_driver (Code Igniter)?

I have to projects on my local server. The were working perfectly. I didn't change anything at all. But when I went to look at them today I got the following error:
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::open) in C:\xampp\htdocs\ci\system\libraries\Session\drivers\Session_files_driver.php on line 49
I found another post at Fatal error: Class CI_Session_files_driver contains 1 abstract method that had the same issue.
However, the answer said this problem was caused becasue changes were made in the system folder. However, I never changed the system folder. Other comments suggested making changes to the system file in question. I tried these changes, despite other comments advising to not change the file, but the changes did not help.
I'm beyond baffled, because I never made a change to any of my files. The applications were working fine yesterday. Suddenly, they are broken.
Problem solved restarting apache.
I attach the url who saves me: http://forum.codeigniter.com/thread-64763.html

Importing file in .pch gives "receiver for class is a forward declaration"

I created a custom class that I want available everywhere, so I imported it in my app-Prefix.pch file under #ifdef __OBJC__
However, whenever I open any class, I get an error receiver for class is a forward declaration, but the project still builds just fine. The errors go away after building, but once I start editing the code again, all the errors come back.
The errors never actually stop my program from building and don't cause any actual errors, they are just extremely annoying and uncomfortable. Xcode knows damn well that the files are available, it's just trying to mess with me.
I'm using Xcode 4.5.1 and ARC.

Part-time bug with extension-methods

I'm currently dealing with a part-time (and annoying) bug with some extension methods in VB .NET (VS 2010 and VS 2008).
I have some client projects that use some extension methods from a "Framework" Project I created for general purpose.
However, sometime, when a try to start the solution, I get a long list of error saying the extension method "is not a member of" target object.
When this happen, I can rebuild the solution without getting any error but if I start the project again, the same error will be raised again.
So far I have 2 workaround
A) Go on the extension method definition, delete the tag, compile (with error), put the tag back.
B) Close Visual Studio et re-open it.
Is there any betterway to handle this problem?
There is an active bug report for this problem at Connect. There's a dire need for a repro, a project with specific steps to let them reproduce the issue in-house. Perhaps you can help, it's what it will take to solve it or recommend a workaround.
EDIT: one late addition to this answer, since I've posted this there have been additional questions that note a problem with the IntelliSense parser behaving different from the compiler. There's an issue with the multi-targeting feature, particularly in VS2010, triggered by the Client Profile option for .NET 4. It is the default for a new project. What goes wrong is adding an assembly reference that requires the full profile, commonly because of a dependency on System.Web. You'll get a warning for that, but that's quickly blown away with a large number of errors. The fix is to change the project's Framework Target from client to full.
I've recently encountered this same issue. My project would Build just fine but if I tried to use the Rebuilt option I would get the error about my extension methods not being found on the objects they were extending.
I have managed to fix this today by including an Import at the top of the classes using the Extension method.
So at the top of the file I actually have
Imports project_name.extension_module
I have no idea why this is required but it fixes the problem in my case. I hope this helps somebody else that has wasted as much time with this as I have!
Liam
A less time consuming work around than the two you listed is to "Rebuild Solution" instead of the normal Build Solution. This has always worked for me whenever I run into this problem.
We have something very similar. Call extensions merhod that extends type A. type is actually an instance of type B that implements interface C. interface C has a method with the same name as extension method.
Interface C declares method Foo
Class B inherits from A implements C
Static Class
Static method Foo (this A)
If A is C
(A as C).Foo
When debugging on the line if A is C it actually calls Foo multiple times and you can step at assembly level and see it indicates it is doing the comparison. The way we demonstrate that the call is happen Foo executes a sql statement and we can see sql profiler executing the code in Foo.
Change A as C to reflection and bug goes away. Or use debugger hidden/step through and bug is masked. Also if you micro-step the sql profiler shows the query is getting called multiple times (before Foo is actually called) for each assembly statement.

Lots of type errors in Visual Studio Error List -- until I build and then they are gone

I recently added a new project to my Visual Studio 2008 solution. Now, as I make edits in the new project, I receive a ton (~50) of type checking errors - indicating that an assembly reference may be missing. However, when I actually build the solution, the errors go away. As best I can tell, my dependencies are set and the build order is correct. What could be wrong?
It doesn't prevent me from building and deploying, but it's a major nuisance. It makes it hard to tell when I actually have introduced new errors (until I do compile). Thus, it erodes the usefulness of having the error window do static analysis.
Example, one of the 50 errors is this:
"The type of namespace name 'PersonManager' does not exist in the namespace 'Gideon' (are you missing an assembly reference?"
In reference to this line of code:
Gideon.PersonManager pm = new Gideon.PersonManager()
PersonManager is underlined in both places, and when I right click the type and selected 'find all references' I get an alert box that says "Cannot navigate to PersonManager"
However, the references are definitely there, because when I build, it works.
One other detail is that there is a mixture of C# and VB.net code, though I don't think that should make a difference.
Well, yes, the IntelliSense parser is not an exact replica of the C# compiler. It has a very different job to do, it needs to do something meaningful while the code is utterly broken since you are editing it. Tough assignment, they did a tremendous job with it. But as a side-effect, it can fail to parse things that are actually legal. It's quite rare but not unheard of, seen it myself a few times.
This won't go anywhere concrete until you at least give us some idea of what kind of errors you are seeing, along with a snippet of the code that generates them. You didn't do so, I can only recommend that you select another window so you don't have to look at them.
I had the same problem. I had a project in my solution that was causing the problem - I removed the project from the solution, then added a reference to that project in the main solution and the errors went away. Strange that it only happened on 1 machine. Opening the solution on another machine was fine...

VS2008 Unit Test Project bugs

I'm using VS 2008 Developer Edition and am finding some bugs with the Test Projects.
I am getting one error that doesn't make sense - I have a class called 'Foo' which I need to test and created the blank test class automatically.
Foo takes 3 paremeters in its constructor - IBar, IBaz, IBang.
When I write a test case, I will Dim foo as New Foo(bar,baz,bang), and I will sometimes get an error that says = 'Type IBang could not be implicitly converted to IBang'. This error does not make any sense.
Even more odd - if I switch to an instance of Foo_Accessor() instead, the error goes away. I've played with the references and then I can eventually fix the above error - but then I get the same error for my Foo_Accessor() class!
I clean, rebuild, and sometimes the error will go away - but then I get the error 'Foo_Accessor' is not defined. Now I go to the Foo class and do 'create accessor' again - again, it still gives the same error. So at this point I'm stuck and my solution won't compile, and the only thing I did was add a new test case through visual studio!
Has anyone seen these issues and could please help?
Also - I have tried everything, including instructions from MS such as - renaming the type, re-referencing the project / in different ways, unloading the projects, etc, etc.. still I wind up with either the 'ifoo cannot convert to ifoo' bug or Foo_Accessor is not defined bug... I'm about to just break down and give the damned property I have to check a ReadOnly accessor... !
It's hard to say for certain but it sounds like you have a problem with your references being setup incorrectly. What's likely happening here is that one of the references between your projects is setup as a DLL reference vs. a project reference. This can confuse the type system into thinking that Bang from the project and Bang from the DLL are actually different types.
I would delete all references between my projects. Then go add all of them back again being careful to select the project from the project tab of the add reference dialog vs. the Browse one. This should fix your problem.
Is this a multi-language project or just a single language project? I've found this type of problem is more likely to occur in a multi-language project but it's certainly happened in a single language one.

Resources