visual studio keeps adding a _1 to a project name crashing the build - visual-studio

I created a project, lets say named AddonLib, which is part of a big solution. For some unknown reason, the folder where the source code was put was named AddonLib_1. I've been trying to get rid of that "_1" for too long now and is driving me crazy. Things I've tried:
removed the project, from TFS and the solution. Renamed the directory. When I try to add the project again, I get the message "The project file "blabla\AddonLib_1\AddonLib.vcxproj" has been moved, renamed or is not on your computer".
Edited the xml file of the solution. Check the project file just to be sure. Removed any trace of the project with and without _1. The project AddonLib is no longer part of the solution. Try to add it back again, same error as before.
Cleared the VS cache following the instructions here. Repeated previous step. Same error.
I cannot find any reference to AddonLib_1 on my code, xml files, anything. But everytime I try to load the project, I get the same error.
Looking for the string "AddonLib_1" using findstr gives no results...
This causes the build to break. Even if there are no references (that I can find) to AddonLib_1, when building in the server I get an error "project AddonLib_1/AddonLib.vcxproj could not be found blablabla"....
Besides the solution xml file, the project xml file, the xml files of the few projects that depend on this project, where else can the information that once the project was in the directory AddonLib_1 ?
More info:
I can remove the project. Remove it from TFS, from the solution, and delete the directory. Create a new project with the desired name. Add the source and header files. Now, I need to add some info to the project xml file. If I open the xml file and edit, when I try to load back the project (Which was loaded before!) I get the same error message. If I open the xml again, undo the minor change I did, I still get the error. Again, this is in a new project, starting from zero.

I was able to solve this issue by removing the .suo file as described in this apparently unrelated answer

Related

Introjucer/Visual Studio 2013 object file clashes

I've got two files in my build named State.cpp. When I generate the VS project with the Introjucer and try to compile, both of those files clash to the same object file and I get the warning:
Warning 1 warning MSB8027: Two or more files with the name of
State.cpp will produce outputs to the same location. This can lead to
an incorrect build result. The files involved are
......\audio\State.cpp, ......\sg\State.cpp.
and then various link errors.
I can correct this easily enough within VS by modifying the Object File Name property on the VS project. However, when I regenerate the project with the Introjucer, that setting gets blown away.
Is there a setting I can use in the Inrojucer's config pages to prevent the clashes?
Just to close this one down...
There isn't. Rename the file for now.
We discussed this on the forum. I think Jules is up for making a change to the Introjucer to fix this - but it hasn't been done yet.
http://www.juce.com/forum/topic/msvc-build-consistency
http://www.juce.com/forum/topic/introjucer/visual-studio-2013-object-file-clashes

Modifying ClickOnce Output Folder Hierarchy

I'm attempting to publish a ClickOnce Office Extension project (VS2010). By default the output folder of ClickOnce has a child folder (with each version of the binary files) named "Application Files." I need to change this to something without a space in the name, for example "AppFiles."
I haven't found any place in the docs where this is explained and the few answers I have found have said to use Mage to manually modify .VSTO file next to the bootstrap setup.exe. I'd like to avoid that if at all possible.
What is the best way to go about changing this?
I have tried a few different things. Instead of using the built in Microsoft.Common.props, In a copy of Microsoft.Common.targets I've modified the _DeploymentApplicationFolderName property inside the _CopyFilesToPublishFolder target to "Application_Files." Also in a copy of Microsoft.VisualStudio.Tools.Office.targets, I've modified the Value of the ApplicationFilesFolderName property set inside InitializePublishProperties to "Application_Files."
Even after doing that, when I publish I get the following error:
Error 121 Publish failed with the following error: Could not find a part of the path '<path to output directory>\app.publish\Application Files\ProjectStats_1_0_0_15'.
I'm guessing the problem is this is happening when the copy from the output dir to the publish dir happens but I don't know. Either way, the output directory hierarchy seems fine and the VSTO refers to the proper path in the hierarchy for the relevant dlls. It's just the publish process fails.
It turns out there's no way to fix this and still use the Publish wizard in Visual Studio. After looking at the code for the Publish method in Microsoft.VisualStudio.Tools.Applications.Project.ClickOnceProvider.BuildManager class in the Microsoft.VisualStudio.Tools.Applications.Project.dll assembly, the directory name "Application Files" is hard coded. There is no way to automatically fix this from what I can tell.

Visual Studio Error: Unable to load arguments for the XmlPeek task. One of XmlContent or XmlInputPath arguments must be set

I opened up VS today to find this error waiting for me when I built my project. I hadn't changed anything since yesterday, when it was working just fine.
Unable to load arguments for the XmlPeek task. One of XmlContent or XmlInputPath arguments must be set.
Of course this error has no line associated with it or anything else that may be helpful...
The project is in the .NET 4 Framework with Console Output.
Any ideas as to what is going on? I tried googling this of course but the few answered I found had to do with a content pipeline (which this project does not use).
Thanks!
I received this error in case, when I have deleted Content Project of my game. It has been solved by adding correct content reference into the Content References directory.
I had two projects (proj1 and proj2) and each of them had their own content projects (proj1_content and proj2_content). I wanted to have one common content project for both projects, so I had deleted both proj1_content and proj2_content and created new content project called common_content. After that, mentioned error appeared. Solution was to go to Content References directory at each project and Add Content Reference pointing to common_content.
Due to a hardware problem I had to put in a new SSD and re-installed VS. All my projects worked except my XNA in Winforms project. Being rather large (12,000 hand-written lines of code) really didn't want to try the "copy it all in to a new project" solution above. Thought I'd try to see what versions worked. All versions prior to me adding an installer project worked. In fact, the version where I had added, then deleted the installer was broken. So I'm not sure how (or if) the installer broke it but I found one section of the main project file that had a missing entry and it did reference XNA also (all my non-XNA projects build just fine). Note that I have substituted my project's name with a reference to YOUR projects name by using <YourMainProjectName>. If your project is joesgreatproject then use that text in place of <YourMainProjectName> (don't include the <> symbols). I think this was only because the XNA didn't have a content directory and needed a reference to one.
File: <YourMainProjectName>.csproj
<ItemGroup>
<ProjectReference Include="..\< YourMainProjectName>Content\<YourMainProjectName>Content.contentproj">
<Name><YourMainProjectName>Content</Name>
<XnaReferenceType>Content</XnaReferenceType>
</ProjectReference>
</ItemGroup>

Compile Setup project with devenv.com - "ERROR: Unable to update the dependencies of the project"

I have a Setup deployment project in VS 2010.
The project compiles perfectly with the GUI interface of VS 2010, but any time I trying to compile it via vs cmd (devenv.com) it comes up with this error:
ERROR: Unable to update the dependencies of the project.
Notice that there is NO dll that mentioned in the error (e.g. the error does NOT contain "The dependencies for the object ‘xxx’ cannot be determined").
Please do not tell me to clean all the files in this setup and start from ground up - this is not a real solution!
I have 5 projects with this exact error, and I don't want to re-arrange each one.
More then that, this does not promise me that the problem will not re-occur in the future.
Thanks very much!
I used to rebuild these installer projects from scratch when they stopped working (for whatever reason), but I've found a much much quicker (and less error-prone) workaround. It works for me. Maybe it will work for you.
Remove the Installer project from your solution through the IDE
interface
Add the Installer project back into your solution (Add >
Existing Project...)
Rebuild
It works practically every time for me...
The hotfix didn't fix the issue on my computer (tried on two computers, rebooted all that jazz)
Instead I used source control to figure out what happened to my .vdproj.
It appears extra corrupt entries are added to the "File" section of the .vdproj.
Suppose you are getting an error such as
ERROR: Unable to update the dependencies of the project. The dependencies for the object 'AutoMapper.DLL' cannot be determined.
In your .vdproj search for AutoMapper and you should come across several { } where it is used.
A normal one looks like this:
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_263299FB43D185D41A44FBEE0253D3ED"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:AutoMapper, Version=1.1.0.188, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_263299FB43D185D41A44FBEE0253D3ED"
{
"Name" = "8:AutoMapper.DLL"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:AutoMapper.DLL"
whereas a corrupt chunk is missing the name of the dll (AutoMapper.DLL in this case) in the ScatterAssemblies section.
Remove this corrupt entry, that is the entire section starting from "{9F6F8455-.. down to the next chunk.
I fixed this by editing the vdproj by hand and removing the Hierachy and File sections and then rebuilding the vdproj
see: Setup project error: Unable to update the dependencies of the project
This worked for me:
Run a clean solution command from VS2010
Open source code folder in explorer
Search for *.exe files, sort by location
Manually delete all files in Release folder
If there exists some_project.vshost.exe locked up file, open properties of this project in VS, and uncheck "Enable the Visual Studio hosting process" under debug. Then remove it as well. It should build now.
This is copied from #timB33's external link, which works. All links to the MS hotfix appear to broken, so this was the only way I could find to fix without removing and recreating the setup project.
I have consistently used this method to get around this bug instead of rebuilding my setup projects. This applies to both merge module projects AND setup projects. Manually remove the data in the Hierarchy and Files section of the project files.
Open .VDPROJ file
Find the "Hierarchy" section. Delete everything so the section looks like this:
"Hierarchy"
{
}
Find the "File" section. Delete everything so the section looks like this:
"File"
{
}
Reload the project
Rebuild the project.
You may need to re-add project outputs if missing something
support.microsoft.com/kb/2286556
thanks Hans, this update fixed my problem.

How do I open a copied project in Visual Studio?

I have copied a whole project onto my PC, both into My Documents/Visual Studio and into inetpub/wwwroot, but when I try to open the project in Visual Studio, it tries to open just 1 file .vssproj and gives me error messages, like : "The project file cannot be loaded. The application for project ... is not installed.". What am I doing wrong?
If VS 2005 has not been upgraded to Service Pack 1 then a web application project (rather than a website) will give this error.
I had this same exact error when double-clicking on the file as opposed to going to VS and using its menu to open it. It seems a problem with file associations.
As others have said, without knowing a specific error it's hard to help. However, the sln and csproj files are just text files, you can always just open them up in notepad and do a search and replace on any obvious path problems. It's often quicker than creating a new project and adding all the files / references.
Without telling the specific error you're getting it's hard to help, but I'm guessing the file paths in the project file are incorrect. Try creating a new project and manually adding the files and see if you get the same errors.
Without the specific error messages, it's tough to be sure, but if you have an entire solution from your source machine rather than just a single project, you may want to try copying that over instead.

Resources