Content Processor Parameters in XNA 4 - what is missing? - xna

I have a content processor in my XNA project and I would like to add a couple of parameters so I can control its behaviour for certain files in Visual Studio.
I follow the second section of this page: http://msdn.microsoft.com/en-us/library/bb975253.aspx, which is the same info as on many other sites, however when I try to specify a property as a parameter I get "type or namespace cannot be found" for the three attributes.
Its probably something like a missing 'using' statement but without a working example project I can't find out what/where the namespace is.

You can find these classes in the System.ComponentModel assembly/namespace. For example, here's the MSDN documentation for the DisplayNameAttribute

Related

VS2019 custom template - parent variable prefix (ext_) not working

I am trying to create a custom template for VS2019 comprised of multiple projects (based on this guide), and I'm having problems with the references.
My solution is based on the classic 3-tier architecture (data/business/ui), so when I create a new solution - call it "MySolution", I get "MySolution.Data", "MySolution.Business" and "MySolution.UI" - all good. I need the business layer to have a reference to the data layer - however, using the $ext_safeprojectname$ variable just gives me an unresolved reference in the projects node of my dependencies to "$ext_safeprojectname$.Data"
Other variables seem to work fine - for example, if I use $safeprojectname$, I get "MySolution.Business.Data" in my reference - correct parsing of the variable, for the business layer project, but not the desired result.
Has the ext_ prefix been replaced? I cannot seem to find any documentation for this anywhere.
Thanks!
I was able to solve it after commenting on your question. I was missing the CopyParameters=true attribute for ProjectTemplateLink element in the .vstemplate file. It is mentioned as a tip on Create a multi-project template from an existing solution. My ext_ variables were replaced once I did this. Your ProjectTemplateLink element should look something like below:
<ProjectTemplateLink ProjectName="MyProject" CopyParameters="true">...</ProjectTemplateLink>

Swashbuckle custom asset not found

I added to SwaggerConfig.cs this string
c.CustomAsset("index", thisAssembly, "Table.Web.CustomContent.index.html");
...than I run the application, go to swagger docs and get error:
An error has occurred.
Embedded resource not found - Table.Web.CustomContent.index.html
Swashbuckle.SwaggerUi.AssetNotFound
The build action property of the index.html was set to embedded resource
What should I do to fix it?
I struggled with this for a while today in a ASP.NET C# project and finally resolved it by cobbling together a few different resources.
First (as noted in the Swagger comments), the item must be marked as an Embedded Resource by right-clicking the item in the solution explorer and going to Properties, and selecting Embedded Resource from the Build Action dropdown.
Second, the logical name can be tricky to identify. In my case, a dash in a directory name was being converted to an underscore once embedded, leading to lots of hair-pulling (hair_pulling?). The easiest way to get the true logical path is to get it from the Build Output window.
Go to Tools => Options
Expand the Projects and Solutions sidebar item and click Build and Run
Set the MSBuild Output to Detailed.
Clean the solution and rebuild, opening the Output window if necessary.
The output log should unambiguously state the true logical name of the file with a line like...
Resource file 'swagger-ui\SwaggerUiStyle.css' gets manifest resource name 'MySolutionName.swagger_ui.SwaggerUiStyle.css'
(credit to #bkwdesign for his excellent explanation on this part)

How to find where is an object declare in GSP

In a gsp file there is line like below
<g:each in="${tools}" var="tool" status="counter">
and when i debug it shows value like below
It's using Grails framework. May I know how can I find where is this ${tools} declared and being called from to this GSP?
Grails uses convention over configuration. So in order to trace back where tool is being set, you have to note the name of the gsp file and the directory in which it is placed.
Ideally if the gsp name is bar.gsp and is placed under foo directory under grails-app/views then the convention is that there could be a FooController.groovy under grails-app/controllers which would have an action called bar(). Most likely the model is set with the variable tools inside the baraction.
This exercise would be a good starting point.
What #dmahapatro suggested is the best approach but if you are still unable to find that tools variable and simply do a project level search in the IDE you are using and find the word tools.
Here are some filters you can apply to fasten your search:
First, search only in the directory grails-app/controllers
Then search in the directory grails-app/directives
Try to search following words: tools, tools:, tools : because it will be rendered as a map.

Properties.Resources.XXXX Namespace or Module not Defined

I'm trying to read in the text (as a string) of an XML file from my Resources. The XML file is named MyXMLResourceFile.resx.
I tried using the C# way using
let myFile : string = Properties.Resources.MyXMLResourceFile
but it is giving me the error (under Properties):
The namespace or module 'Properties' is not defined.
I'm assuming I'm missing an open but have no idea what it would be.
Sorry, I'm still pretty new to F# coming from VB.
Additional information:
I made the resx file myself per this SO answer I then looked to see how others accessed it. In C# they did Properties.Resources.XXXX per this project I saw you could use ResourceManager but didn't see any method to read the whole file directly into a string.
The namespace or module 'Properties' is not defined.
That's because the namespace Properties is not defined. You probably brought the resx file from another project. Open the associated .Designer file, if it doesn't appear in the F# project, open it up in the original project. You will see a namespace with and a bunch of C# code, assuming the original project was in C#. The namespace of this file has to be the same namespace of the project where you are trying to call it.
But, since this is C# code, it won't run on a F# project. You have two choices: use a code generator to generate the associated .Designer class in F# code with the Properties namespace, (I don't know if such generator exists); or pre-compile the resx in the original project and reference it as a dll from your F# project, then you can access it with ResourceManager.

Problem in GetRuleViolations method in NerdDinner tutotial

I'm on about page 70 of the NerdDinner tutorial (MVC 1.0 version). It won't build at this point because it is saying the properties referred to in the GetRuleViolations (ie, Title, Description, etc) can't be resolved. I've compared my own project with the downloadable source code and can't figure out what is missing. The error VS 2008 is giving me is "The name 'Title' does not exist in the current context". I can see the declarations in the NerDinner.designer.cs file.
Did you make sure to import the namespace of the model type?

Resources