The resource type 'XXXX.XXX' does not have a publicly visible static property named '_RequiredXXXX' - asp.net-mvc

"'ErrorMessageResourceType' property specified was not found."
{"The resource type 'XXXX.XXXXXX' does not have a publicly visible static property named '_RequiredXXXX'."}
I'm getting this error when my Create.aspx view is called and steps over that line:
<%=Html.TextBoxFor(Function(model) model.NO_DEMND, New With {.class = "txtbox", .disabled = True})%>
<%=Html.ValidationMessageFor(Function(model) model.NO_DEMND)%>
The message is there in the Ressources file, I think the problem is deeper than that but i'm having a hard time finding it. It pops this error very early on the ASPX page. It's the first model component it goes thru, i tried removing this one and it's the same message for all the model.xxxx components. I guess it's an error somewhere in the linkage. The .EDMX is correct and I get no build errors, can anyone enlight me ?
Thanks alot
Tom.

Found the answer, turns out we had the same bug last year working on this project.
I'll add the answer for the sakes of knowledge and sO :-)
Right click on the affected Resources file to get the properties.
Set those values:
Build Action: Embedded Resource
Custom Tool: PublicResXFileCodeGenerator
Custom Tool Namespace: Resources
Hope it helps anyone in the near futur since it took me 4hrs to figure this out...
Tom.

Changing the build action property of my resource file to content resolved the error

Related

what's causing this Entity Framework 6 runtime error - type or namespace does not exist?

This is an ASP.NET (Framework v. 4.5.2) website currently running reliably in production. A new requirement called for adding a new column to an existing SQL Server table (apProduct) which has been done. I then made the necessary changes to the .edmx file, controllers, views, etc., and everything is compiling fine. However I'm now getting the runtime error below:
When I debug and set a breakpoint where apDepartment is first getting created, I expand the created objects and see this:
My attention is drawn to: "The metadata for 'EntityFrameworkDynamicProxies-AnkoMVC' is invalid."
Here is where apProduct is defined, clearly within the AnkoMVC.Models namespace:
Lastly, here is the DbContext class:
Can anyone offer suggestions on how to overcome this?
I found the problem in the #model reference in many of the views. Here is the faulty code:
This is the corrected #model reference:
Thanks!

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)

Issues with multiple build template (xaml files) in project

I'm having trouble with my TFS Build project. I'm following the example from here as far as setting up the project in VS.
I have a project just for the custom activities and a separate project for just the templates. The issue I have is that the Templates project can only contain one xaml file. If I copy and and paste it in the same project it wont build. I get the following error:
Error 102 The item "obj\Debug\TfsBuild_Process_BeforeInitializeComponentHelper.txt" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.
But if I remove it, it'll build just fine. Everything works, meaning it'll build if I queue a build.
I have also tried the solution suggested on here, but it doesn't seem to resolve my issue.
Solution:
Renaming the form name in the solution explorer.
Change the class name in the .cs and Designer.cs file.
Change the constructor and destructor name (which is same as class name)
Change the name space name (if needed).
Here is the link to download the project.
I can't seem to figure out why. Any help is greatly appreciated!
I don't know if you still have this problem but I also had the problem today. I found a resolution that (if you still facing the problem) can help you or others.
When you copy a Build Process template it automaticly gets the x:Class property set to TfsBuild.Process. When you have multiple process templates with the same value then you will get this error when building the project.
<Activity mc:Ignorable="sads sap sap2010" x:Class="TfsBuild.Process" this:Process.BuildNumberFormat="$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)" this:Process.AgentSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly}]" this:Process.Verbosity="[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]" this:Process.OutputFullHistory="True" this:Process.OutputBranchOrigin="True" this:Process.OnlyOutputChangedFiles="True" this:Process.StartChangeset="0"......
I solved the problem by replacing TfsBuild.Process with another name for every template (ex. TfsBuild.ProcessLabDefault). Please note you should also change all the instances of this:Process because the two are linked together (ex. this:ProcessLabDefault).
<Activity mc:Ignorable="sads sap sap2010" x:Class="TfsBuild.MyProcess" this:MyProcess.BuildNumberFormat="$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)" this:MyProcess.AgentSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly}]" this:MyProcess.Verbosity="[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]" this:MyProcess.OutputFullHistory="True" this:MyProcess.OutputBranchOrigin="True" this:MyProcess.OnlyOutputChangedFiles="True" this:MyProcess.StartChangeset="0"......
I didn't find a way to change this by using the interface, View Code & Find and replace works. Hope it helps.
I used the following approach and it worked very well. All that needs replaced is TfsBuild in two locations on the first line of the raw xaml.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/d3fb6b89-b711-4a02-a10a-a88a0cb4f714/unable-to-add-more-than-one-templatexaml-into-activity-library-workflow-project?forum=tfsprocess
From the link:
1 Right-click your Copy of DefaultTemplate.xaml in Source Control and select View With… to open it in Notepad (you can also right-click the template in VS and select 'View Code').
2 Then in the first line change:
**x:Class="TfsBuild.Process"** to **x:Class="YourProcessTemplateName.Process"**
**xmlns:this="clr-namespace:TfsBuild"** to **xmlns:this="clr-namespace:YourProcessTemplateName"**
I ran in to this problem and wanted to add the solution I found to it. If you check the properties of the XAML files, when you link them to your project they're assigned a BuildAction of XamlAppDef. Changing this to 'Content' will resolve the error.
To find the properties screen you need to edit just highlight the XAML file in Solution Explorer and either hit F4 or Right-Click on the file and choose 'Properties' from the context menu.
Hope this helps.

Attributes from MvxBindingAttributes are not added with MvvmCross

I have the MvxBindingAttributes.xml in my UI.Droid/Resources/Values but everytime I try to use the bindings in my layouts I get
Warning attribute is not declared.
No resource identifier found for attribute 'MvxBind' in package
'DroidUI'
so for some reason it cannot find those attributes. I have tried to close/reopen/clean/rebuild with no luck, tried removing the layouts and then building (Hoping it would add them at build) and then try to add them again, but nothing seems to work
Have you checked that the MvxBindingAttributes.xml file is marked in properties as an AndroidResource?
VisualStudio likes marking the xml files as content or none instead - especially if you've added the MvxBindingAttributes.xml file as a link.
As an update to this, you can also now use a special 'auto' xml scheme:
xmlns:local="http://schemas.android.com/apk/res-auto"
In the project properties, add a Android Manifest file and add a package name that contains at least two periods, for example:
com.DroidUI
In the axml file, type the package name instead of the namespace:
xmlns:local="http://schemas.android.com/apk/res/com.DroidUI
xmlns:local="http://schemas.android.com/apk/res-auto
Fixed it for me.
First, thanks for the answer. I had the same problem.
But in my case, attempting to use the suggestions above failed. or at least that is what i thought.
When i used local:MvxItemTemplate=#layout/My_Manifest while i had the My_Manifest.axml file correctly placed in Layout folder, and correct xml schemas, it still had problems.
But, when i changed My_Manifest to my_manifest while leaving the actual file name as My_Manifest.axml, everything was working.
just wanted to share
In my case for some reason the MvxBindingAttributes.xml file existed, but hadn't been included in the project. Right-clicking on MvxBindingAttributes.xml and choosing "Include in Project" sorted the problem for me.
Just in case: You might also have rubbish (in my case, it were dots) in some of your XML. But the error pointed "Maybe there's something wrong with the auto-generated XML lol" so it took me half an hour to notice it... Sigh!

cakephp Router::parseExtensions('ics') doesn't work properly

I'm trying to create an ical-file.
So I set Router::parseExtensions('ics') in router.php.
I created a folder ics in app/views/layouts and a default.ctp with this content
<?php
header('Content-Type: text/calendar');
echo $content_for_layout;
?>
In my reservationsController I created a ical() action and created a ical.ctp in /app/views/reservations/ics/.
So, if I'm trying to access http://localhost/reservations/ical/1.ics I get an error:
Error: The view for ReservationsController::ical() was not found.
Error: Confirm you have created the file: C:\xampp\htdocs\ers\app\views\reservations\ical.ctp
So I'm a bit confused about the error-message. Why does it search the ical.ctp in app\views\reservations\ and not in app\views\reservations\ics\?
When I'm using another extension like .xml the error message looks like this:
Error: Confirm you have created the file: C:\xampp\htdocs\ers\app\views\reservations\xml\ical.ctp
Why does xml work and ics don't? What went wrong?
I've just finished dealing with this situation myself. I'd been trying to get a csv extension to display, and I was also getting the "missing view" error.
Everything was in place; I had my /app/views/layouts/csv/default.ctp and /app/views/users/csv/export.ctp view files set up. I had Router::parseExtensions('csv'); at the top of my /app/config/routes.php file.
Turns out, what I had forgotten was to add the RequestHandler component to my controller's components array: var $components = array('RequestHandler');.
Once I did that everything worked perfectly.
So if you've stumbled upon this question because you're having the same issue, check to be sure you're loading the RequestHandler component fixes things for you...
I just had the same trouble creating the ics example # http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2
Needed quite a while to figur out that this seems to be a cake bug and opend a ticket for it :)
http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2565-cakeresponse-is-missing-icalendar-and-not-responding-as-documented
Hopefully this will be resolved soon.
PS: I also posted a workaround / quickfix for this until it is fixed in the core.

Resources