I have a Binary folder in my application. I put all my external dlls in this folder and reference them all from this folder. We us telerik controls, when I get the latest dlls from telerik they are in ProgramFiles(x86)/telerik...etc. I then add these new dlls to my Binary folder. So I remove the telerik reference and then add a reference that is to the file in my Binary folder. When I add this file it always shows my 'Path' as being the file in my ProjectFiles directory not my Binary folder.
No matter what I have tried it always seems to revert back to the Program Files file - when I need it to have the path to my Binary folder.
Related
I want to avoid duplicating 400+ files in the Assets folder of my UWP App project folder. I want to tell VS to take files from an arbitrary location in my source tree, and use those in the Assets folder, preserving folder structure etc for deployment. I don't even mind setting the pathing manually in the project file properties if I must.
Is there a way to do this? The best I got was to right click on Assets\BlahFilter -> Add -> Existing Item. This results in the file appearing in the Solution treeview in the place I expect, but when deploying, the file appears in the root of AppX folder, ignoring any subfolder (filter) structure specified above.
I fixed this. You can use a "Custom Build Step" and treat the output as content. This will result in VS packaging that output directory's contents in the final AppX package. You can specify a folder, and all sub-folders will be automatically copied. The build command can be blank, or something innocuous like 'echo "blah"'
How can I change AngularJS or another project's output files location. For example the .js files of AngularJS's default location is ~/scripts folder but I want to move it to ~/content/js folder.
It is easy to move files but when I try to update AngularJS, the new .js files go to default location. Is there any workaround or way to solve this problem?
This is not possible with NuGet. The folder location for files is defined by the NuGet package creator.
I have a ASP.Net MVC 5 application. In this application I have an "Images" folder. As a sub folder, I have a "logos" folder which will be filled out by the application when requested.
When I publish (on file system), the sub folder is NOT published.
How can I publish this empty folder (without having to add a "dummy" image)?
Thanks.
Last I knew there was no way around this, and the VS team were aware. I get around it by putting an "empty" web.config in the folder.
I do not understand the need to publish an Empty folder,
Why not just try and create the folder on startup (or when needed)?
System.IO.Directory.CreateDirectory(Server.MapPath("~/images"));
It is not even needed to check if it pre-exists as the docs suggest
Any and all directories specified in path are created, unless they
already exist or unless some part of path is invalid. The path
parameter specifies a directory path, not a file path. If the
directory already exists, this method does nothing.
I am trying to add an icon to an executable file produced in Visual Studio 2010 from a relative path since the project is intended to be distributed and compiled on several machines but I can't get it working. These are the steps that I perform:
Right-click on Resources -> Add Resource -> Icon -> Import
Then I import my icon which is two directories upward from my project ../../images/icon.ico
Then I compile and I get the icon on the exe but if I open the auto generated .rc file with a text editor, the path to the icon is hard coded and if I move the project on another computer with a different file structure it doesn't compile.
Is there a way to set the icon with a relative path? Or to make the .rc file work with relative paths?
Yes, the resource editor will only generate a relative path if the resource is located inside your project directory or a subdirectory of directory. You could just edit the .rc file yourself. Right-click the .rc file in the Solution Explorer window, Open With, select the Source Code Editor and edit the ICON statement.
Beware the future headache you'll induce by doing this. This doesn't just go wrong on that other machine, sooner or later this will go wrong on your machine as well. When you check-out the project in a different directory or that images folder has just disappeared. The absolute path as generated by the resource editor solves that first mishap. Not the second one of course. Always favor copying a resource file to your project directory so you can easily check it in to source control and cannot lose the file.
To avoid this problem, our projects share the same disk partition -- a dedicated disk partition -- then you can enter an absolute path, but without typing the drive letter, such as \path\to\my\icon.ico.
Besides working in rc.exe, this also works in the IDE.
These are the advantage of dedicated disk partition + absolute file notation:
Create as many partition as needed to maintain trunk, stable and branches separately, without breaking resource compiler
If you have lots of static libraries spread over your project partition and need to #include library relative .rc files to produce a statically linked .exe you can add #include <\path\to\your\static\library\resource.rc> in you compile time directive box. This will also work with the rc.exe tool.
I have to formate my PC. I have installed Visual Studio again. Earlier I have a project
on Visual Basic. I have the Project files saved as .VBP extn and also have and ExE file for
the same project. It is also running. But How can I retrieve the Forms i have created in VB from these Exe and Project file.
Let's clear something out of the way first, there's no strightforward way to get those forms out of the .exe file, so that is not an option.
On the other hand, the .vbp file is the project file, it does not contain the forms themselves, but it can help you locate them forms.
Visual basic doesn't require for the form files (.frm) to be stored on the same folder as the project file, that is why the project file stores the location of those forms. All you have to do is right click on your VBP file and select open with from the context menu, then select notepad from the list and you will see the plain text contents of your VBP file. Around the top there should be a few lines that look like these (depending on how many forms your project has):
Form=Form1.frm
Form=....\Form2.frm
Form=..........\Source Code\Form3.frm
Those are the "relative" paths of each of the frm files on the project. If yours looks like the first one where there's no path, then it means the frm files where stored in the same folder of the vbp and you have lost them (someone might have deleted them, or not copied them when they sent you the project), in that case there's nothing you can do to retrieve them.
But if the lines on your vbp file look like the second and third line, then search into those folders and the form files "should" be there, but unfortunately there's no warranty.
Hope that helps!