Why move the key.snk file to the Properties folder in Sharepoint projects? - sharepoint-2010

It is "de rigeuer" here to move the key.snk file generated when a new project is created from its default location at the bottom of the Solution up into the Properties folder.
This is not just a local "superstition"; it seems to be the "accepted method", as seen here
But why? That book does not seem to explain the raison d'etre for this action...

It makes no difference where the key file is located as long as the assembly is signed.
The author explains why she/he does that:
"As projects become more complex, a lack of vertical space in the Solution Explorer makes projects more difficult to work with"
So the reason seems to be to hide the key file inside the properties folder to save some space on the visual studio Solution Explorer display.
My personal opinion is to ignore that as that will confuse another developer which is expecting to see it in the default location: in the project root.

Related

Reference dll from resources

I need to reference in my project a dll library that contains a UI component. So I literally drag and drop it in solution explorer tab, then I add this code on top of XAML page:
xmlns:Banner="clr-namespace:(the namespace);assembly=(name of the dll file without extension)"
When I try to compile the solution, it says that the assembly was not found.
The problem could be build action of the dll? I tried setting the property to "copy always" and the build action to "resource", but with no luck.
Try to check these, common step i do when facing problem with third-party dll reference:
Have you added reference to that dll from your project? if no then add it, if yes check the following
in solution explorer > references, is the reference to that dll marked with warning sign (yellow triangle with exclamation mark in the middle)? if no, that means this is not a common problem, maybe the dll itself problematic or what i'm not sure in this case. But if yes, it means that the dll no more exist in the folder location where you reference it. Copy the dll to that folder location or remove that reference from project and add again pointing to folder location where the dll actually exist.
ps: Hope this help. And sorry if you already did all that before posting the question, all i know what you did is drag and drop the dll to solution explorer.
UPDATE :
After your comment i get what you are after actually. As far as i know, to be able to use dll in code you need to add it as reference in project. Thats why i suggested above steps, to make sure that the dll appears fine in references list in solution explorer. Drag and drop dll or any file to solution explorer only make it included in the project. And including file in project doesn't make it usable from code (except .cs/.vb file). CMIIW.

Why does dragging an objective-C header or code file from one folder to another make it turn red in Xcode 4.6?

I have an Xcode 4 objective-C project which contains about 150 .m and .h files in it.
The code underlying the project does not always correspond in underlying disk structure to the folders shown in the Xcode project. I get that part.
What I don't get is why Xcode won't tell me anything about why I can create new project groups and move items to them, with no problems, but certain existing project folders will cause the project to become broken, and the code will no longer build once I move certain .m files or .h files into a different group. When its broken it just shows the file in red. This is frustrating and confusing.
In the screenshot below, the left side of image before shows state before, when all is good, right side shows red (missing) file after moving into a group. Given that groups don't represent a folder on disk, I would not expect moving from one group to another to break things. Sometimes it does, and sometimes it does not. This particular XCode issue upsets me a lot.
In the good old days of Friendly Mac User-Interfaces, you could hit ⌘+I and get some information about the properties of objects, or right click and get to the properties of something via its context menu. Groups (folder icons) in XCode projects have no properties item in their context (right click menu) and yet these groups all clearly NOT all alike. What's up with these identical looking groups?
Secondly, how does a person learn how to reorganize both the on-disk-folder-organization and the visual group organization, in a way that does not leave you bloodied and beaten? (XCode 4 is the most difficult IDE version I have ever used, for this, I'm sure I've missed some important documentation on dealing with folders and files and so on.)
Update: The File Inspector (Identity Inspector in Utilities menu) is the key to this mystery, but exactly how a new user is to discover this (other than by painful experience) is still unknown to me. I also don't really understand what all this is about, with various choices available in the Path drop-down, and the blank or non blank value that has no description or help, just a cryptic icon and either a name of some real on-disk-folder or else a gray text field saying None:
This sort of thing doesn't just happen out of the blue. In this case, what has happened is that a user has opened an .xcodeproj and is unaware of the difference between the various relative or absolute Path options that a Group can be a part of. A Group in XCode is always shown with exactly the same manilla color folder-icon inside your XCode project, no matter what modes or properties it has defined inside of it.
By default the simplest case is that you create a new folder Group object in XCode and it's purely a cosmetic organizational tool that has no disk location information stored in it.
This is not the ONLY thing that these groups do, and not the only "mode" that these groups can be used in. These groups can also be used to point at some folder and say "things that are in this virtual folder are really somewhere else, either underneath this project's main folder in a subdirectory, or even up somewhere else on your hard-drive, either stored in relative path, or absolute path format". When used like this, these things remind me of a Windows "Shortcut" object on the desktop, or a Mac "Alias" object in the finder.
Dragging a file from one group to another does not move it to a different folder on the disk. It simply moves a reference to a file with a certain name, to another group, which might mean that after you drag a file, you haven't really moved it, or copied, or relocated it in any way, you've just moved an alias from a place where it could resolve properly to a real file, to a place where it can't. Thus XCode helpfully turns it red for you, without any helpful error message about what happened.
How do you fix it? In this case, go to the Identity inspector pane in the Utilities menu, and either decide to clear out the bogus value in the place where I have shown in the picture in the original question where I had "Classes". Clearing out a value that is invalid is not exactly easy to do because XCode requires that you basically find the root folder of your project and select that, and that will 'clear" the relative or absolute path property on your folder-group.
Alternatively, you can leave the folder alone, and just don't drag files from group A to group B without first checking what relative or absolute path they reference.
What still seems horrible to me is that XCode tutorials tell you to "use XCode to manage your project's contents, don't just drag files around in the finder inside an XCode project directory", and that's good advice, but it leads me to assume that XCode provides full and intuitive physical (and virtual) group-folder organization tools. It does not. As an example, imagine you inherit a project that has .m and .h files scattered through four physical folders underneath the main XCode project folder and you want to move those files around. You have to do a combination of tricky things inside XCode, and either in Terminal or in the Finder, in order to reorganize your folder. With the complications involved in moving items around in your version control tool of choice added upon the top of that, and XCode's very limited support for only Git and Subversion, you have a really tricky mess.

Adding DLL reference to VB.NET project

Just to start off, this question does seem very similar to another post Add the DLL (lame_enc.dll) reference to my project, but I haven't been able to successfully apply that answer. I am pretty new to VB.NET so it is very possible I'm simply missing something obvious.
I am trying to link a DLL to a VB.NET 2010 project to allow my VB app to play *.ogg files. I followed some other advice here on the forums and downloaded FMOD's FMOD Ex Programmers API. I am trying to now reference that functionality. These appear to be the files I need to somehow reference.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex64.dll.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\libfmodex64_vc.lib.
I haven't discovered how to add a *.lib reference (or the equivalent), but selecting the DLL as a reference gives the following error.
A reference to 'C:\Program Files (x86)\FMOD SoundSystem\FMOD
Programmers API Windows\api\fmodex64.dll' could not be added. Please
make sure that the file is accessible, and that it is a valid assembly
or COM component.
I'm not sure what I could be missing. Any ideas? Thanks!
In Solution Explorer, double-click the My Project node for the project.
In the Project Designer, click the References tab.
Click the Add button to open the Add Reference dialog box.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, then click OK.
Another approach I was trying is working for me. I found a site with a working example of a LibZPlay VB.NET sample ( http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7789&lngWId=10 ). It runs under VS 2008 and I was able to adapt my project to use LibZPlay (open source library http://libzplay.sourceforge.net/WELCOME.html ) under VS 2008.
That is sufficient for me for now. Thanks for your advice. It was likely some configuration issue or misunderstanding on my end.
Using VB.net 2015 I (could not add or even find a System32 dll) as a reference using Solution Explorer, Tab References. Going to the MAIN Menu, Projects/Add References...
Used Browse and All the System32 dll were visible. Then I was able to load the needed dll.

Why would a .sln file open as empty in VB2010Express when it should open referring to projects etc. as it did before?

Why would a .sln solution file open and appear empty in Microsoft Visual Basic 2010 Express - i.e. no windows showing projects and code files etc.
When I inspect the file in a text editor, it contains references to vbproj files (which are present) which indicate that it should not appear as empty.
No error messages are reported when the file is opened.
Update:
(To illustrate my problem)
It attempts to load the projects that belong to the solution:
And then results in a bare solution screen
Express Edition is limited to on project per solution. If you have more than that, you will not be able to use the solution file with the express edition of visual studio. You will need to open the projects separately.
The answer is that the projects did load for the solution but the Window to display them was not open or visible. To make it visible, go to the View menu and select Other Windows:
This displays the 4 projects referenced by the solution
Forgive me for blurring the project names but this might be commercially sensitive and therefore not for public awareness. But you get the picture.
In summary it was my lack of knowledge about the tool, though I had looked under the Window option first thinking along these lines, but the View menu is actually where one would go to display things about the project.
Thanks to everyone for your contributions.

How do I add an existing folder to Visual Studio 2010 Express project?

I'm trying to add a folder and some files within it to a Visual Studio 2010 Express VB.NET project. I have read the answers to questions on this subject here and here. They both say "select folder, right click, and then select Add To Project".
But when I right-click in this way, no "Add to Project" option appears. Does anyone know why this is so, and what I can do about it, or alternatively another way of adding a folder to a project?
Yes, this works fine. Click on the "Show All Files". You'll see ghost images of all the files that are not included in your Solution. Right-click on the folder that you want, then click the "Include in Project" It comes right in with no problem and shows up in your Solution Explorer menu.
I found this:
Visual Studio - Add Existing Folder
Instead what you can do is hit the "Show All Files" tool strip button at the top of the solution explorer, then right click on the folder you want to add and hit "Include In Project". Pretty trivial. Its amazing how long you can use a product and not know about all of its features.
Click on File.
There you can add a new or an existing project.
Once you've added a new or existing project, you can rightclick and add projects on the solution explorer.
So there is absolutely no need to show hidden fiels etc.
I understand your problem because I also use VB.Net 10 Express, and have also used the pukka versions. You do NOT, as you are aware, have the right click add to project facility however there is a way to add an existing form/class/folder etc to a project, but you have to be prepared to dive into the .vbproj file.
Here is an example of one I added to one of my projects. First of all EXIT VB.NET
Now copy the .sln, .suo, .vbproj, .vbproj.user files somewhere else or just zip them up as a backup in case you manage to screw it all up!
Next open the .vbproj file with an editor. You could use notepad or textpad but I use and recommend scite. Anyway whatever you use it must be a plain text editor. Forgive me for stating the obvious but do NOT used Word, WordPad etc.
In the file find the section that starts
<itemgroup>
You can tell if you have the right one by the fact that the entries say
<Compile Include=
Other groups say reference include or import include and you don't want those. Within that section add the code needed to get your folder and files into the project. Here is a sample:
<Compile Include="SuperPro Extras\FGeophysicalReport.designer.vb">
<DependentUpon>FGeophysicalReport.vb</DependentUpon>
</Compile>
<Compile Include="SuperPro Extras\FGeophysicalReport.vb">
<SubType>Form</SubType>
</Compile>
Note that your FOLDER is added at the front of the file names. For each of the vb files you should add the name of the designer file and the name of the code file (as above).
Finally you need to include the resx file. You will find another ItemGroup that comtaines the embedded resource files. The resx file is added into this group in exactly the same way.
<EmbeddedResource Include="SuperPro Extras\FGeophysicalReport.resx">
<DependentUpon>FGeophysicalReport.vb</DependentUpon>
</EmbeddedResource>
Note the folder\filename on the first line and then the dependency WITHOUT and folder name.
I know this is a LONG time after the question was asked so possibly not usefull to you but I hope it helps someone else. I think I will develop a utility to do this. I have one for assembly/file numbers so this would be a useful addition.
I wanted to add a little more comprehension to this as some of the directions were not explicitly clear considering one's level of Visual Studio knowledge. Here's a quickie on how I accomplished this task (using VS2013).
Drag/drop folder you want to include in the Resources folder
(i.e. %path%\"Project Name"\"Project Name"\Resources\)
For this example, I wanted to add a folder structure named AppData.
In Solution Explorer, on Top Panel, click Show All Files then click Refresh.
Locate your folder (mine: AppData) under Resources then right-click > Include In Project.
Images for guidance: