I have a project in TeamCity and I am trying to update one of its inherited parameter's values, the parameter is inherited from the parent project and has a blank value.
When I PUT a new value against the API, a new parameter with the same name is created with the correct value, but the inherited parameter's value remains blank.
I am using the C# the FluentTC library to do this but I have also tried using the TeamCity REST Api directly.
var teamCity = new RemoteTc()
.Connect(h => h
.ToHost("teamcity")
.AsUser("someUser", "somePassword));
teamCity.SetProjectParameters(project =>
project.Id("someProjectId"), buildConfig => buildConfig.Parameter("someParameter", "4"));
The documentation for the above code can be found under the "Set project parameter" here.
Any help would be greatly appreciated.
I had this problem for quite a while, which confused me because the request and response all looked good.
Eventually I found that I had edited the inherited value in the child project, which was causing the problem. It was always using the overridden value because I was accessing the parameter in the build steps of the child project.
To solve I pressed the 'reset' button against the parameter in the child project's properties, and this constant override was removed. The value turned from black to being greyed out, showing the true value of the parameter in the base project, which is the one that the REST api updates.
Related
I'm placing a new face-based family instance into my Revit model with the help of the NewFamilyInstance Method (Face, XYZ, XYZ, FamilySymbol) method described here. This works fine, except the instance does not have its level set to that of the host (it's set to -1 when accessed through the API and just left blank in the UI).
I tried setting the level like such
placedInstance.LevelId = hostWall.LevelId
and following this approach also tried
placedInstance.get_Parameter(BuiltInParameter.FAMILY_LEVEL_PARAM).Set(hostWall.LevelId);
but both throw an error saying the parameter is readonly.
Any help would be appreciated!
On some elements, the element level can only be set during the creation of the element. For that, I would assume that you need to use a different overload of the NewFamilyInstance method. Please refer to this explanation by The Building Coder and a few recent discussions of related topics in the Revit API discussion forum:
Change level of existing element
LevelId is null
Change level on line based family
So I am currently working on an extension and I want to change the Build Action of a specific ProjectItem to None.
What I tried
I noticed that the ProjectItem had a Properties property which contains the following KeyValuePair wher the key is BuildAction. Therefor I tried to set its Value to prjBuildActionNone which should be the correct value for it.
Anyway, when I hit Play and the code runs and I set a breakpoint on this very line:
prop.Value = "prjBuildActionNone"
The Debugger will never return to the line below and that is it.
Is there anything I am doing wrong with this approach or is this the totally wrong direction and the Properties property is for read-only purposes?
The value should be a member of the prjBuildAction enumeration, e.g. prjBuildAction.prjBuildActionNone.
Execution is not reaching the next line because the incorrect type is causing an exception.
I have a VS C# project (project1) that compiles and works fine without any errors.
I have created a second project (project2) that adds a number of files as links from the first project. I've added all the necessary references etc. I've created a conditional compilation symbol for project2. Project2 is giving one error:
There is no argument given that corresponds to the required formal
parameter 'info' of 'Curve.Curve(SerializationInfo, StreamingContext)'
public CurveCollection(List<Rhino.Geometry.Curve> curves)
{
this.CurveList = this.CurveList;
}
I've searched through the forums to try and find why this error is being caused, and I'm at a loss.
Can someone shed some light on what I may be missing?
As i said this line of code which you wrote doesnt do anything it just initialleze this.CurveList as its value, i think you should change yours to this:-
public CurveCollection(List<Rhino.Geometry.Curve> curves)
{
this.CurveList = curves;
}
I am currently using the RazorEngine library to create html Email templates. Code:
var result = Engine.Razor.RunCompile(File.ReadAllText(templateFilePath), key, typeof(T), data);
Within the template itself I want to get access to some of the helper methods provided by MVC, namely #Html.Format(string string);
However Whenever I add said line of code in the template is:
Errors while compiling a Template.
Please try the following to solve the situation: * If the problem is
about missing/invalid references or multiple defines either try to
load
the missing references manually (in the compiling appdomain!) or
Specify your references manually by providing your own IReferenceResolver implementation.
See https://antaris.github.io/RazorEngine/ReferenceResolver.html for details.
Currently all references have to be available as files! * If you get 'class' does not contain a definition for 'member':
try another modelType (for example 'null' to make the model dynamic).
NOTE: You CANNOT use typeof(dynamic) to make the model dynamic!
Or try to use static instead of anonymous/dynamic types. More details about the error:
- error: (180, 97) The name 'Html' does not exist in the current context
Which does explain that I need to reference the right namespace. Question is, what do I reference and where?
Are you looking for HtmlHelper in System.Web.Mvc ?
Ref: https://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper_methods(v=vs.118).aspx
I'm trying to programmatically create indexes corresponding to several types, so I can search through items of specific types in my controllers. (I tried using the type keyword in Lucene, but that seems to not work at all no matter what I do, so I changed my approach.)
However, I can't figure out how to tell Orchard to include a specific type in an index in a migration. I tried using:
var typeIndexing = ContentDefinitionManager.GetTypeDefinition(contentType)
.Settings.GetModel<TypeIndexing>();
typeIndexing.List = typeIndexing.List.Concat(indexName.Yield()).ToArray();
but that just returns null as the result of GetTypeDefinition().
I'm looking at using:
ContentDefinitionManager.AlterTypeDefinition(contentType, builder => {
builder.WithSetting("TypeIndexing.Indexes", indexName);
});
but that seems like it replaces the previous configured index, if it works at all (EDIT: nope), and I don't want to clobber the existing setting. (A different person on the team is handling our setup recipe.)
Is there any place where I could touch that setting and have it be stored and actually used by Orchard outside the recipe file?
To illustrate what I'm trying to accomplish using the analogous admin UI changes, under Content Definition > [Content Type Name] > Edit:
Before:
After:
What you're looking for is the Indexed() extension method. It accepts the indexes you want to use on the content type.
ContentDefinitionManager.AlterTypeDefinition(nameof(contentType),type =>
type
.Indexed("FirstIndex", "SecondIndex"));