VS2012 Assembly is incorrectly specified as a file - reference

I am getting this warning on assembly references in a VS2012 Winforms application project. In this case the references are for Infragistics controls used by the app, which are located in the bin folder.
This issue has been addressed in the following link, but the answer ("set the Build Action" property) doesn't work because there is no Build Action property in VS2012 for referenced assemblies.
VS2005: Assembly '<assembly>' is incorrectly specified as a file.
What's the fix?

You probably refer to the wrong Assembly.
You need to "set the Build Action" for the Assembly which located in Bin folder, NOT from references.
Go to Solution Explorer > Expand the Bin folder, right click on the
Assembly that give warning, and you should be able to set the Build
Action
Again, it is not the assembly that located in the References panel but it is from Bin Folder

Have you tried removing the references, saving the solution and exiting Visual Studio - then re-opening the solution and re-adding the references?
The problem is almost certainly lurking in the project file (.csproj if this is a C# app) if you fancy opening it up in a text editor and having a look - might also help if you were to paste it here.
Alternatively, have you tried recreate the project from scratch? May be a quicker solution than trying to work out what's happened.

Related

Extend Visual Studio functionality for Installshield ISPROJ Project type

InstallShield must be the crappiest "industry standard" application in existence, for reasons too numerous to enumerate here. However, one of those deficiencies is something I'd like to be able to fix, and with my first foray into writing an extension for Visual Studio (currently using 2015 version).
InstallShield has created a .isproj type, to allow integration with Visual Studio. This allows a developer to create an installer that references the output of a project as the files to include in the installer (rather than having to manually select individual files to include). This works well enough as long as the .isproj is being built in Visual Studio, and in a solution that references the project for which you need the output.
However, I also have an automated build for my installer projects, that we run on a build server using MSBuild. When attempting to build this way, we were getting completely opaque error messages indicating that the project output references above couldn't be resolved.
As with all InstallShield errors, Googling for answers turned up nothing except for multitudes of other people having the same problem. So I decided to dig into the plain text of the .isproj to see what I could find.
As it turns out, the .isproj type is a just a regular MSBuild script, and it even has lines commented out that explain options that can be added to the project; one of those things that can be added is an ItemGroup containing ProjectReference nodes. Manually adding the nodes helped solve the problem. Command-line build now works.
However, I am dissatisfied with a) having to manually type this stuff in, b) having no visual representation of what projects are being referenced, and c) not finding out about a problem until the build fails. So, I would like to be able to extend Visual Studio to help me with this. Here's what I'd like to do:
1) Add a "References" node to the project in Solution Explorer that acts like the References node for any normal .csproj.
2) Restrict the available References to other projects in the the current solution.
3) Visually represent a project with missing references (e.g. by underlining the project name with a colored squiggly, as with errors/warnings), and potentially failing the build if missing (depending on whether I want to treat it as an error or a warning; TBD).
To these ends, I've downloaded MPF for Projects - Visual Studio 2013, which provides an SDK for creating a new project type.
However, before digging too deeply, I need to know if it's even possible to EXTEND an existing project type, as described above, as I obviously don't have InstallShield source code. Also, any links or guidance as to a starting point for doing so would be greatly appreciated.

Rename Android Studio project causing a bunch of errors and java files missing

Following some links here I tried to rename a project. I went to c:\path\to\AndroidStudioProject and renamed the folder there, then found the .idea file and changed that. Now the project loads but java files are missing! However, on clicking java (in the bar at the top), then com I can see them each with a small red j.
I then looked in module Gradle build where there were 3 files, one with the new name and 2 older ones which stated that they did not belong so I deleted them, copying the compile info into the new one. Naturally on doing a Sync Now I get a bunch of errors.
Why does this have to be such a complex operation? Can anyone assist?
After you rename the folder, open the project in Android Studio. From there, right click something that needs to be renamed (e.g., module, package names, etc.) and use Refactor->Rename from the context menu. Keep doing this until everything that can be refactored is.
You will need to manually change the value of applicationId in the app-level build.gradle. Obviously, things like #string/app_name will also have to be changed manually. I recommend making these manual adjustments from inside Android Studio rather than directly editing the files. That way you'll know immediately if you break something.

VS2012 Project Reference's Properties' path does not match .vbproj HintPath

My goal was to update a reference from my old DLL to a newer version that was updated to VS2012.
D:\DEV\<old_path>\TEST\bin\Company.dll
D:\DEV\<new_path_2012>\TEST\bin\Company.dll
In the .vbproj file...
<Reference Include="Company, Version=0.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\<new_path_2012>\TEST\bin\Company.dll</HintPath>
</Reference>
In the Solution Explorer, Under References, I right-click on the Company reference and click Properties. The Path is listed as...
D:\DEV\<old_path>\TEST\bin\Company.dll
There are no errors or warnings. Everything is appearing to build properly however I lack confidence because of this discrepancy. How can I fix this?
I have tried restarting VS2012 and have tried deleting the TFS Cache. Downloading a fresh copy of this project from TFS on another PC seems to resolve the problem however I would like to better understand how to resolve this without such drastic measures.
I just had this issue crop up, and while this is an old thread it was the first Google result when I did my search, so I thought to offer what had happen for me.
TL;DR: Triple check the hint path - it could be wrong, and VS is using the DLL in the GAC.
My issue came up because I was using a little script to help me update over 250 projects worth of references, and had a small handful that didn't follow normal folder layout. So my hint path was 'correct' at first glance, but because it really wasn't, VS 2013 went to the version of the DLL in the GAC.
Once I clued into what was wrong and fixed the relative path for that project file, hint path and what was displayed in References matched up as it was supposed to.

How to tell VS2012 C# debugger where to find sources

I'm trying to debug a third-party library. I have it's .pdb and sources. I put .pdb near my dlls. When I step-into third-party code for the first time, VS2012 asks where are the sources. I pick the correct file and everything is fine. Now, I'm rebuilding my code with another version of the same third-party lib. I have another version's .pdb and sources. When I step-into, it doesn't ask where are the sources, instead, it just connects to the SAME SOURCES it connected at the first place. I can close the file and open file from new sources, but each time I press F11 to step-into another file, it continues to open files from the old location.
Visual Studio remembered the selection you made and stored it in the hidden .suo file in the solution directory. You can edit it. First ensure that the Solution Explorer window displays the solution name (similar to "Solution 'name' (x projects)"). If not then use Tools + Options, Projects and Solutions, tick the "Always show solution" checkbox.
Right-click the solution in the Solution Explorer window, Properties, Debug Source Files setting. You should see the directory you added in the original debug sessions. Delete it and add the new directory.

Visual C++ Express How Exactly Do I Link A Third Party Library DLL

YES, I have seen the posts that all you need to do is link it. Find you .lib and link. I have 10 years IT experience and its not at all clear to me where/how the link settings are made. This is a DLL that is not in another project. I have the lib and I have spent hours just trying to find out how to pull this in. Just curious, why there is not some tab saying external libraries, and a browse button to goto whereever you stored this on your file system? I just don't get the multiple steps to get this file linked up. Someone please spell it out. I'm on Visual C++ Express 2010.
Did you try just using "Add Existing File to Project", browsing to the .lib and adding it? Visual Studio recognizes the file type and passes .lib files to the linker.
There's another way which is more complicated and also more powerful. You can open the project properties by right-clicking the project in Solution Explorer. Then go to the Project Directories and add the path to the LIB paths, then go to Linker Input and add the library name (without path) under additional inputs. The advantage of this second method is that you can have different versions of the .lib and .dll for release vs debug, or 32-bit vs 64-bit builds.
In addition to Bens answer, you can also use pragma directives:
#pragma comment ( lib, "path-to-library-file.lib" )
Some prefer linking libraries in the project, others prefer it in the source file. It doesn't make much of a difference either way.

Resources