Visual Studio for mac broken(doesn't compile) - c#

After an energy fault, my mac mini was shut down inappropriately and now I simply can't work anymore with VS for mac(8.6.7 build 2). If I add a new class file or any new xaml tag, giving it a name and reference it on code behind, VS doesn't links these references. This already happened other times but this time it doesn't compiles the project also.
Error CS0103: The name 'MinhaAnimacao' does not exist in the current context (CS0103) (MyProject)
Everything that was compiled before that works fine, so if I compile without new elements it pass ok and VS finds its references as expected.
I was using VS 8.4, have updated to 8.6.7, but no success. Also tried to delete bin/obj from main folder(not on android/ios folders).
EDIT:
Just have noticed that VS broke the project files. With other projects it works fine. Do you guys know how to fix project files?

Related

Why my Visual Studio 2019 still compiling the last program without changes?

I had created a new project in C # Visual Studio, and when compiling it, the project is showing me the last compiled project. I try to change the form visual and compile again but doesn't work, still showing me the last form visual compiled.
Does anyone already have this problem?
Compiled program:
Changed I had created to compiled again:
But, when I compile, still showing me the program without changes.
Your solution explorer is loading the last cached project. The easiest way is to just close Visual Studio and then open your project by folder.
After that try navigating the folder and search for
/bin, not just /bin/Debug. All /bin.
Delete it and try rebuilding the solution.
if any Temp folder you see, just delete that.
I solved that!
Idk why, but the instance of the new form in this solution has lost its configuration of the form.
The solution to that is:
change the name form;
create a new instance:
~(example) FormScan frmScan = new FormScan();
reload everything and compile;

"This source file has changed. It no longer matches…" error

I have a primary project which refers to DLL of a secondary project. I changed some code in secondary project, built it and changed the DLL reference in the primary project to the updated DLL.
Now, in VS 2010, when I press F11 to try and debug the updated code from the secondary project, it shows the following error and takes me to the old code when I press OK.
This source file has changed. It no longer matches the version of the
file used to build the application being debugged.
I have tried Clean+Build, Rebuild, cleared temporary files etc. I checked the properties of the DLL and its path points to the newer version(updated code). But the problem still persists.
In short, VS is completely ignoring the new code. Any clues how to resolve it?

Change dll References in Visual Studio

I'm trying to create a Monogame Project in Visual Studio 2012. Monogame itself is installed correctly, I've cloned one of my older projects from github and it compiles fine.
But if I create a new project in Visual Studio the .dll references are wrong. There is a build error that complains about not finding SDL.dll . There is the SDL.dll reference in my project outline and it indeed points to the wrong file:
This path "C:\Users\lhk\Program Files..." does not exist. Windows doesn't store Program files in its "Users" folder.
I opened the explorer and opened the very same path without "Users\lhk\" and the .dll is found.
Then I checked my older project again. The same SDL.dll is referenced in the Visual Studio solution but the path is the correct one. And the older project compiles just fine.
Somehow the Monogame Project template fills in the wrong paths.
Now here's the problem:
I can't edit that reference.
The text is greyed out and not editable and I didn't find the correct settings to change the reference.
Oh, the problem is solved:
I tried drag-and-drop with the dll.
So far Visal Studio always complained that there is an existing file with the same name.
I tried to "cut" the wrong .dll but that only made its icon slightly transparent. The new .dll still couldn't be added.
Turns out that the ENTF key can do what cutting can't.
I'm afraid I never got the idea that I could delete it with ENTF after cutting didn't work. Now its gone.
I dragged the new dll over to the project.
Compiles fine
Apparently you can just drag and drop references to a project.
At first I thought this wouldn't be possible because the wrong .dll just couldn't be deleted. I tried to "cut" it from the project but it just changed the color of its icon and persisted.
With the old .dll still intact the new one couldn't be added.
I'm afraid the solution is extremely simple. You can just remove this reference by pressing "ENTF" - it's rather embarrassing. But I never thought this would work after cutting had no effect.
With the old reference having been removed you can indeed drag and drop the new one.
The project compiles fine.
What I did is create a path on the drive and put the sdl.dll file there. So whenever I make a project Visual Studio finds it.

Visual Studio Could not write to output file '...\obj\Debug\Foo.Bar.dll"

I've got this error while compiling a big c# solution in Visual Studio 2010.
Each time after compilation I had to delete obj folder of one the projects used by this solution. Otherwise I got the following error:
Could not write to output file '...\obj\Debug\Foo.Bar.dll'
The process cannot access the file because it is being used by another process
I've was looking for a solution all over the Internet and actually found/tried few of them.
For example : a lot of people on dev forums were suggesting not to start the compilation while UserControl (in some other sources From) designer is opened.
Some other people used pre-build scripts for obj folder removal, this particular solution is acceptable, but if the issued project is a widely used library its recompilation will cause recompilation of "parent" projects.
Finally I've discovered a solution for this VS2010 (SP1 too) "bug" and I want to share it with stackoverflow users.
In my case the problem was that csproj file was SELF-REFERENCING the locked '...\obj\Debug\Foo.Bar.dll' file. Crazy I know.
So I solved this annoying issue by removing the following line from .csproj file:
<Reference Include="Foo.Bar">
<HintPath>obj\Debug\Foo.Bar.dll</HintPath>
</Reference>
I initially found another solution to the problem as VS seems to lock the assembly in the obj\debug folder. I added a pre-build script to the project which fixed my problem.
del "$(ProjectDir)obj\*.*" /S /F /Q
After seeing the answer given by Salaros, that was indeed the problem. I created a new usercontrol that uses a Server control from another project. For some reason VS sometimes creates a self-references to itself when you view the usercontrol in design mode. Even removing the self-reference fixes it until VS thinks its time to add the reference again. Haven't found an exact pattern for that part.
PS: I'm using vs2012
In my case for me somehow the exe file was missing from release. Not sure how this happened. I replace it with a copy from debug and all was fine. I should have checked this sooner but never thought that the file would just turn up missing.
This problem happened to me when I:
Opened Visual Studio
Ran debug
Went to C: and used system cleanup
If you try to build again, you will find this error.
Solution:
Close Visual Studio
Do system cleanup
Restart your computer
Open Visual Studio as administrator
Choose your project
Clean
Rebuild

Issues with intellisense, references, and builds in Visual Studio 2008

Hoping you can help me -- the strangest thing seems to have happened with my VS install.
System config: Windows 7 Pro x64, Visual Studio 2008 SP1, C#, ASP.NET 3.5.
I have two web site projects in a solution. I am referencing NUnit / NHibernate (did this by right-clicking on the project and selecting "Add Reference". I've done this for several projects in the past).
Things were working fine but recently stopped working and I can't figure out why. Intellisense completely disappears for any files in my App_Code directory, and none of the references are recognized (they are recognized by any file in the root directory of the web site project.
Additionally, pretty simple commands like the following (in Page_Load) fail (assume TextBox1 is definitely an element on the page):
if (Page.IsPostBack)
{
str test1;
test1 = TextBox1.Text;
}
It says that all the page elements are null or that it can't access them.
At first I thought it was me, but due to the combination of issues, it seems to be Visual Studio itself.
I've tried clearing the temp directories & rebuilding the solution. I've also tried tools --> options --> text editor settings to ensure intellisense is turned on.
I'd appreciate any help you can give!
If you think it is VS then try running it with this command line to get it back to factory defaults: devenv /resetsettings
Alternatively you may be experiencing issues due to the fact that intellisense only works on code that is (pre)compiled check the following:
a required folder is marked as excluded,
there is an issue compiling a referenced project.
compile error in the global.asax class. Note: extra { or } in a class bubbles from the root folder, usually kills intellisense. (Clean solution then build watch output for error's)

Categories