在构建时或运行时获取解决方案路径(get solution path at build time or runtime)
我有一个C#解决方案,我希望在构建期间将解决方案的路径设置为app.config。 例如。 让我说我有解决方案
c:\temp\visual studio\super fun project\super_fun_project.sln
open。 我构建并在其中一个测试项目中将应用程序设置更改为解决方案的完整路径。 即<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="fullSolutionPath" value="{setAtBuild}"/> </appSettings> </configuration>
如果我要去
c:\temp\visual studio\super fun project\Foobar.Tests\bin\Debug\Foobar.Tests.dll.config
它会看起来是<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="fullSolutionPath" value="c:\temp\visual studio\super fun project\super_fun_project.sln"/> </appSettings> </configuration>
或者它需要进行格式化,以便在运行时我要求的值我确实得到了正确的路径。 我查看了转换,但我无法弄清楚如何设置解决方案路径。 有没有其他技巧可以得到这个?
I have a C# solution that I would like to get the path of the solution be set to the app.config during build time. for instance. Lets say I have the solutions
c:\temp\visual studio\super fun project\super_fun_project.sln
open. I build and in one of the test projects a app setting is changed to be the full path of the solution. ie<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="fullSolutionPath" value="{setAtBuild}"/> </appSettings> </configuration>
that if I were to go to
c:\temp\visual studio\super fun project\Foobar.Tests\bin\Debug\Foobar.Tests.dll.config
it would look be<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="fullSolutionPath" value="c:\temp\visual studio\super fun project\super_fun_project.sln"/> </appSettings> </configuration>
or however it needs to get formated so that when at runtime I ask for the value I indeed get the correct path. I've looked down Transformation, but I can't figure out how I would get the solution path set. Are there any other tricks to get this?
原文:https://stackoverflow.com/questions/35665193
最满意答案
按如下所示修改/ etc / hosts文件:
127.0.0.1 localhost 10.0.3.107 HadoopMaster amrit 10.0.3.108 HadoopSlave1 10.0.3.109 HadoopSlave2
还要修改10.0.3.108机器的/ etc / hosts,如下所示:
127.0.0.1 localhost 10.0.3.107 HadoopMaster 10.0.3.108 HadoopSlave1 HOME 10.0.3.109 HadoopSlave2
并在10.0.3.109机器中修改/ etc / hosts,如下所示:
127.0.0.1 localhost 10.0.3.107 HadoopMaster 10.0.3.108 HadoopSlave1 10.0.3.109 HadoopSlave2 shubhranshu-OptiPlex-9020
Modify your /etc/hosts file as follows:
127.0.0.1 localhost 10.0.3.107 HadoopMaster amrit 10.0.3.108 HadoopSlave1 10.0.3.109 HadoopSlave2
Also modify /etc/hosts of 10.0.3.108 machine as follows:
127.0.0.1 localhost 10.0.3.107 HadoopMaster 10.0.3.108 HadoopSlave1 HOME 10.0.3.109 HadoopSlave2
and modify /etc/hosts in 10.0.3.109 machine as follows:
127.0.0.1 localhost 10.0.3.107 HadoopMaster 10.0.3.108 HadoopSlave1 10.0.3.109 HadoopSlave2 shubhranshu-OptiPlex-9020
相关问答
更多-
你错误的原因: 引起:java.net.BindException:地址已在使用中:bind 说明:默认情况下,Jenkins使用端口8080(与许多其他Web应用程序一样)。 显然,您已经有另一个应用程序侦听端口8080。 所以你应该将Jenkins绑定到另一个端口。 有关更多信息,请参阅启动和访问Jenkins 。 例如,您可以从 java -jar jenkins.war --httpPort=8081 The cause of your error: Caused by: java.net.Bin ...
-
从您的设备中删除此文件 /mnt/secure/asec/smdl2tmp1.asec Mathias Conradt编辑/更新(OP): 如果您没有root访问权限,则需要安装sdcard并通过pc将其删除: /.android_secure/smdl2tmp1.asec remove this file from your device /mnt/secure/asec/smdl2tmp1.asec Edit/Update by Mathias Conradt (OP): If you don't ...
-
Hadoop:Pig错误(Hadoop: Pig error)[2022-09-27]
所以......我尝试使用mapreduce选项运行Pig脚本: pig -x mapreduce script.pig 它仍然失败,但它至少产生了一个有意义的错误。 我似乎不得不从CSV文件中删除标题,因为Pig使用标题行作为数据。 这似乎只有在使用浮点数时才会发生 - 如果使用带整数的相同脚本,则只会忽略标题行。 就是这样。 首先从文件中删除标题,而不是对它运行脚本 - 它工作。 So ... I tried running Pig script with mapreduce option: pig ... -
hadoop上的python流mapreduce作业失败 - 缺少log4j?(python streaming mapreduce job on hadoop failed - missing log4j?)[2022-03-19]
您应该只提供本地 python文件的名称作为-mapper和-reducer参数。 它们不需要在HDFS上,也不应该使用命令行提供字符串来执行脚本。 您还需要为每个脚本提供-file参数。 尝试使用 hadoop hadoop-streaming-2.7.1.jar -file /home/user_name/Documents/mapper.py -file /home/user_name/Documents/reducer.py -mapper /home/user_name/Documents/map ... -
CoreOS单元发布失败(CoreOS Unit Failed on Launched)[2023-06-09]
您的ExecStartPre =命令似乎没有docker子命令。 你的意思是使用pull ? 阅读该单元的期刊应该可以获得更多信息: journactl -u chat.service Your ExecStartPre= command doesn't seem to have a docker subcommand in it. Did you mean to use pull? Reading the journal for the unit should get you more informati ... -
这是Hadoop的另一个链接,可能有助于理解Application Master(如上所述@nigge)。 http://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html Here's another link from Hadoop which may help understanding the Application Master (as @nigge noted above) ...
-
像其他程序一样启动eclipse, 生成一个'项目'。 将文件添加到项目中, 然后单击运行将触发所有文件的编译,这将创建目标文件。 然后是所有目标文件(和需要的库)的链接以生成可执行文件,然后尝试运行该可执行文件。 在项目完全创建之前,IE运行没有任何用处,并且在编译没有错误并且链接没有错误之前会有很多失败 Start eclipse the same as you would any other program, generate a 'project'. add files to the project ...
-
此错误现已解决。 如果有人遇到类似的问题,我想发布在我的情况下,它是由HADOOP CLASSPATH未在Mesos Master和Agent容器中设置引起的。 一旦设定,一切都按预期工作。 This error is now resolved. In case anybody encounters a similar problem, I wanted to post that in my case it was caused by the HADOOP CLASSPATH not being set i ...
-
经过所有这些研究和帮助后,它归结为当前版本的Xamarin的一个错误。 选项是等到Xamarin网站上的新稳定版本或GIT构建。 我选择等待,因为我没有好好运用临时版本。 与新的VS 2017下载的Xamarin修复了这个错误。 After all the research and help from those here it comes down to a bug with the current version of Xamarin. Options are to wait until a new s ...
-
按如下所示修改/ etc / hosts文件: 127.0.0.1 localhost 10.0.3.107 HadoopMaster amrit 10.0.3.108 HadoopSlave1 10.0.3.109 HadoopSlave2 还要修改10.0.3.108机器的/ etc / hosts,如下所示: 127.0.0.1 localhost 10.0.3.107 HadoopM ...