Combine two config files as an a single file - asp.net

I have a project with 3 subprojects:AdminPages, UserPags ,UIpages,each part has a separate files.for example AdminPages is coded by MVC4, Userpages and Uipages is coded by ASP web form .
So i have 2 config files,my question is can i combine these two files into single file?Or i have to put each project in a special subdomain ?
Thanks.If i can i will add config files to this post.

With a little google, I came to an answer where it was stated that you can use: XmlConfigMerge.
A qoute from the site:
The XmlConfigMerge utility (provided both as a library assembly and as a console application) supports this merging of XML .config files, and also supports setting of specific parameters via XPath filtering and optional Regex pattern matching.
Go there and try their code and documentation. Good luck!

Related

How to create MPEG-DASH manifest with multiple fallback URL?

I have a URL like this http://.../test/index.mpd. What I want is create another dash manifest that will contain multiple fallback URLs pointing the original manifest file.
For example for URL http://example.com/test/index.mpd (original manifest), the new manifest file should contain multiple CDN URLs like:
http://cdn1.com/example/test/index.mpd
http://cdn2.com/example/test/index.mpd
http://cdn3.com/example/test/index.mpd
I found something similar in following URL https://bitmovin.com/docs/player/faqs/how-can-i-utilize-the-cdn-fallback-feature-of-the-player. However, this example adds base URLs to the original manifest file and It does not work for dynamic manifest(live stream). Is there any way to do that. I cannot find good documentation or examples on dash manifest manipulation.
The proper way to do this is via BaseURLs. What do you mean by "It does not work for dynamic manifest"? BaseURLs work independently of the manifest type and definitely do work in dynamic manifests. Perhaps your player is at fault?
Another option is to specify the alternative MPD URLs in <Location> tags which allows you to specify multiple locations at which the MPD is available, but IMO BaseURL is better specified for CDN failover.

openapi documentation how to handle extension in the path

I have URLs like:
/return/{pid}.xml?d1='123'&d2='345'
/return/{pid}.json?d1='123'&d2='345'
the swagger specification calls for:
path:/return/{pid}
....
but how can I map the extension ie
path:/return/{pid}.xml
or
path:/return/{pid}.json
It is a jersey+spring mvc application - so both the URLs are hitting the same controller and only based on the extension the rest framework is going to generate the xml / json output.
I can't ignore the extension from the path ie:
path:/return/{pid}
because the user needs to know that he/she has to provide the file extension as part of the URL. Also I can't use two paths corresponding to xml / json because they are treated the same by the application. In addition it will duplicate things (I am not sure whether there is a fall-through like mechanism just like "case" statements in c++/java "switch" block)
In Swagger specs,You can define the file extensions in the path as below :
/return/{pId}.{fileExtension}
and define the fileExtension in parameters .
also the below is valid (not for your case) :
/return/pid.{fileExtension}

How can I change this .NET code to File.Exists?

I am working with a framework written in .NET and I do not know .NET. I just need to change this one line where it checks to see if a variable exists, and I need to change it to instead just check on the server to see if the file itself exists.
Here is what is there now:
#if (!string.IsNullOrEmpty(Model.DrawingLink2){
Is this the correct code to change it to check if the file exists instead?
#if (File.Exists(/Portfolio/#(Model.FileNumber)/Images/Large_#(Model.FileNumber)_1.jpg))
You need to map that file, relative to the root of the web application, to the physical file system. You can use HttpServerUtility.MapPath for that. You also need quotes around string literals. The process running the code also needs read access to the directory (very likely the case, just mentioning it to be complete).
#if (File.Exists(HttpServerUtility.MapPath("/Portfolio/#(Model.FileNumber)/Images/Large_#(Model.FileNumber)_1.jpg"))

Asp.net resource file to localize a web site: what to put in?

When we use resource file to localize a web site , we should put in the resource file also html tags in order to create less entries in the file?
this is <a href="www.alink.com" >a link<a>
or it is better to create two separe entry
entry 1: this is
entry 2: a link
I prefer the first option, because the second relies on grammar and not all languages share the same grammatical structures.
For example, it's possible another language might need something like "a link this is", in which case option 2 will not work.
I think , you have to create key/value pair for each word, so it will help for reuse it.

ASP.NET Read Resources values

I have two .resx files: en.resx and he.resx, in the folder App_LocalResources.
I already have two buttons in my web page, clicking each one is supposed to "switch" to the other language's resource file.
I want to simply get a string value located in one of the .resx files.
I tried some of the examples I have found on google, and I asked myself, why do I need to provide an Assembly type and a namespace, when i just want to ask for a string value in my own project?
Why isn't there something like: string val = Resources["en.resx"]["SomeProperty"].Value?
Maybe my whole approach is wrong, and I would like to read your opinions.
Thanks, Guy
using System.Resources;
ResXResourceSet Resource = new ResXResourceSet(HttpContext.Current.Server.MapPath(#"~/Properties/Resource.resx")
String value=Resource.GetStrin("key");

Resources