.Net c# visual studio 2008 error - c#

I have the project solution bin in below location for dll, pdb . my build is getting failed due to below error.
C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\bin\debug\CommonServices.pdb
C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\bin\debug\CommonServices.dll
Error
The command "C:\Users\myusername\Documents\Visual Studio 2010\Projects\mysolution\bin\debug\CommonServices.dll" exited with code 3.
I tried by cleaning the solution and build / Rebuild. Either way, it is not given result.
Please help.

maybe you have some errors on PropertyGroup.
Read this:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/589ffae3-59ca-4d0a-a7b1-9f1120db3792/msb3073-the-command-exited-with-code-3

A couple of things to consider and try - in the title, it says VS 2008 error, but the path points to 2010, are you sure it is pointing to the right reference for 2008?
If it is, try closing Visual Studio, deleting the pdb file. This will eliminate any pdb issues with building, as the pdb file will be recreated.
Then also delete the .suo file, this will also be recreated. This is to eliminate any build issues that may be caused by Visual studio version conflict.
Another thing to check is if there is any build events in your project that may be triggering this error, go into project properties and remove/edit any build commands.

Related

Visual Studio 2012 debug using different dll and pdb

I am trying to open a dump file using Visual Studio 2012 but there are some PDB files missing.
Is there a way to make the debugger use another PDB file, built on my machine?
Unfortunately, I can't access the original DLLs and PDBs.
I'm trying to open my PDBs using the "Browse and find ***.dll..." button but I'm getting an error message saying "a matching symbol file was not found in this folder"
Visual Studio does not have an option to ignore mismatched symbols. Other debuggers (like WinDbg) have that.
ChkMatch is able to modify a PDB file so that Visual Studio does not recognize the difference any more. However, the result is what it is: even a slight modification might cause the compiler to emit totally different code. What you see in Visual Studio may be totally misleading. See this answer for details.
Be warned: delete the modified file immediately after your investigation or you will hunt ghost bugs sooner or later.

'the type or namespace could not be found' in Visual Studio 2017

Every time I do a git pull from remote to update my branch, Visual Studio 2017 shows "the type or namespace could not be found" error in many files as I open them. Interestingly I don't see the problem in Visual Studio 2015 for the same projects/repo. The software builds fine in both versions of Visual Studio so it is a false error. Doing a Clean or Rebuild doesn't fix the problem. I end up re-cloning the repo from remote and then Visual Studio 2017 is happy. Any one knows how to fix this annoying problem?
The problem is the package-restore. If it fails, you get the issue.
You can try to unload and reload the projects, but I also still haven't found a way to avoid it.
Unloading and reloading the project did not work work me.
Instead, I delete the hidden .suo file inside the project directory and everything started working again. The path is:
(project name) \ .vs \ (project name) \ v15 \ .suo
In my case I had csproj.user file that I've removed and then reloaded the project.
This issue occurred in VS 2019 while participating in a C# Essential Training course. My solution is:
Save the entire project
Close project
Open project

Could not find DATABASE.SQLPERMISSIONS

When building our rather large solution (50 projects) in visual studio 2010 I get the following error. Once I get the error restarting the computer a couple (well once is enough sometimes) of times fixes it for a while and then it reoccurs.
The solution contains both WPF, WCF and database-projects.
Error message:
Could not find a part of the path 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\PROPERTIES\DATABASE.SQLPERMISSIONS'. C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 10.0\COMMON7\IDE\PROPERTIES\DATABASE.SQLPERMISSIONS
The DATABASE.SQLPERMISSIONS-file is located with the other property-files in the database-project where the error always occurs. The build action, copy to output directory and other file properties are set to the same as other, working database-projects.
I've tried
Deleting the databases from my local SQL-server
Redeploying
Clean/Rebuild/Build
Removing the database-project from the solution build definition
Restarting the SQL-server/IIS before rebuild
Deleting output-folders before rebuild
and a whole lot of other things, to no avail.
Does anybody have any suggestions to a semi-suicidal developer? Why would visual studio try to find the permissions-file in program files?
Deleting the project metadata (*.dbmdl) file should solve 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

Visual Studio 2010 error building, due to missing files

I've searched everywhere and I can't seem to find anyone with the same problem (although I'm sure people have made the same mistake in the past)...I accidentally deleted the contents of my Debug and Release folders. Now I am getting file not found errors. As a background, it's a Windows Forms Application in C#, and I'm running Visual Studio 10.
Here's the errors:
Unable to read manifest 'bin\Debug\projectName.vshost.exe.manifest'
Could not find file [pathName]\projectName.vshost.exe.manifest.
Before I was missing the manifest, I was getting an error that it could not find the other contents of the folder (the exe, the pdb, etc.), error MSB3113 (link)
Things I've tried (and some of them were far-fetched, I know):
I tried renaming bogus files for all the missing files
I tried to find the deleted files, but can't
I tried deleting all the contents of the Debug/Release folders and doing a clean build
I tried deleting the Debug/Release directories
Let me know if you can think of anything I could try out. My issue seems to be vaguely similar to this one.
Here's how I ended up solving the problem - turns out I included my bin and obj directories in my project. For anyone experiencing the same problem, simply right click and "Exclude From Project." After doing this, clean and rebuild your project, and you should be good to go.
In my case the file app.manifest was checked-out. This file is located in my Winforms project under Properties folder. I selected this file from Pending Changes window and did "undo pending checkout". After that the build succeeded. This happened in Visual Studio 2008.
Worked for me: Properties => Build => Generate serialization assembly => change from Auto to Off

Categories