Reference another file in TFS - tfs

Basically I have a solution which is having 2 projects.
Main Website
Console Application which will be used to schedule Jobs.
My problem here is the both the projects are using a XML file which have lots of configuration. The developers are updating the file in the main project but not in the Console App.
So is there any way to include the XML file in the main project into the debug/release folders of the console application directly. So that, when they get the latest of console app, it can pickup the file from the referenced location that is in the main project. Hope I am making sense..!
-Ram

I suggest you to Specify the File Add Option, add config file in Main Project and to add another file but by linking on the first.
Every change on first is reflected on second file.
link : http://support.microsoft.com/kb/306234

You want to just have once copy of the XML file checked into TFS.
Then, add that one XML file to both website project and the console application projects. Set the properties of the XML file to Content - Always copy.
Something like this would work...
/root
/Website
website.csproj
/Console
console.csproj
/Config
MyConfigFile.xml
In both the website.csproj and the console.csproj you would have an entry like this...
<Content Include="..\Config\MyConfigFile.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>

Related

Can you create URLs for files in sphinx regardless of where they are saved?

Can you change the location of 'rst' files in sphinx without changing their URIs? I'm working on a documentation where we want to move some files to different folders, without changing the URIs:
For Example: If you create a sphinx project with $ sphinx-quickstart and add some files and folders:
index.rst
/tutorials/howToFoo.rst
/scripts/
With the toctree in in index.rst looking like that:
.. toctree::
:maxdepth: 1
:caption: Processing:
:glob:
scripts/*
tutorials/*
Then after building the project with make html, you have a link in your browser as seen here: tutorials/howToFoo.html
If you want to save the the file in a different folder:
index.rst
/tutorials/
/scripts/howToFoo.rst
Then the URL of your file howToFoo.rst changes depending on where it is saved:
scripts/howToFoo.html.
This is a problem because I don't want links to tutorials or scripts to break.
As the project aims to include many people, it will be very probable that there will be changes in the file structure in the future.
Now my question: Can you create a setup where you can move the files without having to write redirects to their new location, every time you move them?
For Cross Referencing inside of Sphinx this is solved for example with targets, explained here:
https://docs.readthedocs.io/en/stable/guides/cross-referencing-with-sphinx.html#automatically-label-sections
But this doesn't help me because the link in the browser still stays the same.
What I want is a link SomeNeverchangingLinkFor_howToFoo.html regardless of where the file howToFoo.rst is saved.

Use settings file in .net core 3.1, single file published windows service

How to correctly use JSON settings files in windows services build in 3.1 net core, that are published in a single file.
Publishing as single file, requires you to do two things. First, exclude the settings JSON file from the single file. If you do not do it, it will be unpacked together with the rest, loaded and it will appear to work, if there are default values in it. And second, copy the settings file to the publish directory. You can do this by adding this:
<ItemGroup>
<Content Update="appsettings.json">
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>
In your pubxml profile. Building it from the interface with: Build > Publish (Project name) will not work. You gotta use the command line from now on.
Once packed into a single file, the base path of your application is changed. Simply placing the JSON files next to your exe will not do the trick. Also, you will be using windows services. Starting the exe is one thing, starting the service is another universe. In most situations you can use the following:
Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
To get the directory of your single-file packed exe service.
The packed exe checks the temp folder it creates for resources, you need to redirect some of the features to another folder. You will want to do this, at least for your log files and settings. For example, if you want the application to check for JSON files near your exe, you add this:
.ConfigureAppConfiguration((context, config) =>
{
config.SetBasePath(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));
})
in your CreateHostBuilder method.
I hope that this will save you some time. Ive been fighting this all morning.

Grails: get all files from War

I am using Grails 3.1.1
Last month, I had my project, but my hard-disk became corrupted because of a bad sector. I tried bringing my hard-disk to a "Recovery DATA"'s store.
But that store cannot recover my data, so my project's data is gone now.
But I still have the War file on my customer's server.
I just want to know: Is it possible to get my project back from a War file?
My War file is still running on the server, but all my source code is gone.
No it's not possible to recover your entire project, including source code, from a WAR file. The WAR contains the compiled version of your code, not the source.
If you don't have any option and need to rewrite the application again, I'll suggest some ways:
Remove your hard-disk from laptop/desktop. purchase HDD internal sata to external USB case for desktop/laptop hard disk. which connects with connectors with circuit(Sometimes this helps you in boot-sector error also).
Connect it to the laptop and check is it showing HDD. If yes check data is available not. If HDD size showing correctly but data not available then you can recover data with " EaseUS Data Recovery" software.
If all above fails?
Copy your project war from server to local computer.
Install WinRAR or any other unzip software.
Select and open your war file with it.
See above screenshot,
Where assets folder contains js, css, images and all your other files.
which may be minified if you set minifyJs = true and minifyCss = true in your application.yml
Now, see very important folder called WEB-INF
See above image which contains two folders:
classes : This is very important folder which contains your controllers class files and gsp files.
Controller files are .class files where for each action from controller will generate separate .class file. You can de-compile dot class files using many online/offline tools.
In case of gsp you will get original files.
Also you will get application.yml and other files as it is.
Hope it helps you.

How do I put content into the iOS Documents folder at compile time, using Xamarin?

I have a data file that I need to include with my app when I distribute it. When loading any files in the app, I prefix the file name with:
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
This works great for anything I create within the app (and for reading back), like files I download in response to a user action. But I can't for the life of me figure out how to place files there when I build my app in Visual Studio.
I've tried making a "Documents" subdirectory in the special "Resources" folder, but that didn't work (I tried setting the "Build Action" to both BundleResource and Content). When I look at the folder for my app (from using the simulator) I can see that in the "Documents" folder there's all the files I downloaded, but I can't find my data file that I'm trying to bundle ahead of time. I even searched my entire hard drive on the Mac and still couldn't find said data file.
The data file isn't an image, if it matters. Just raw binary data. How do I set it up so that this file goes into the proper documents directory at compile time, so that I can read it using the SpecialFolder.MyDocuments prefix? Thanks.
You can't. You can include files in your app bundle, and then at startup copy them from the bundle into a user folder. But this won't happen automatically.

How can I route my solution into different projects?

I'm looking for a solution to be able to store my websites in individual projects, while keeping one project as an entrypoint that can route into those projects.
The ideal setup would be something like the following:
- Main (entrypoint)
- Website1
- Website2
- Website3
I need this format to allow someone to access their website (ie. Website1) as a solution they can run and debug on their own, without having access to the entire application.
Basically, I want to be able to set up a new project, add the reference to the Main project, add an entry into my routes, and allow the new project to be built out and tested if it needs to be.
Is this possible?
I've looked at using areas and tried several plugins, but I can't seem to get this working properly. My biggest issue right now isn't routing into the project's controller, as I can get into that action perfectly, but once there, I can't reference any of the ASPX files properly. (I need to be able to reference them within the context of the project and the entire solution.)
If anyone could direct me towards other resources or questions I might have missed, I'd appreciate that as well. Thank you!
You should be able to doe this using a source control program of your choice. Put each website project in a separate folder and reference each website project file to a main master.sln file in a different folder called MasterSolution. Commit it all to source control. Then, for a user that opens Website one only, they just do open project, and go to the Website1 project folder and open the project file for Website1. Your MasterSolution is not opened but always gets the latest code as after the Website1 developer does a commit of his/her Website1 updates.

Resources