Error Deleting Document Type - c#

I am getting a weird error on an Umbraco site I maintain. I'm trying to delete an old Document Type that I am replacing with an updated one. The error I am getting is:
Error handling action Item has already been added. Key in dictionary: 'textpage' Key being added: 'textpage'
The document type is not called "textpage" and doesn’t have any link to "textpage" that I can see. There are no physical files on the server and this error didn’t happen on the staging site nor did it occur on my local test. So I am a little stumped!
Any suggestions?
EDIT: This is also occurring if I try to save any document type in the CMS.

It could be a cache issue. Try touching the web.config file and see if the issue goes away.
Another thing that can cause this is if you have multiple templates with the same alias. Check for that as well.

Related

Error when publishing dynamic module contents Sitefinity

When I try to update the dynamic module contents and click on publish it is showing a popup with message 'The type initializer for '' threw an exception' and I am not able to publish any content.
This is an inconsistent issue for me. It is weird that without doing any change at times this issues does not happen but it comebacks again. Can anyone please help me with this issue. Is this anything related to server update or server utilization because recently I added some more contents to the modules no other code changes or anything was done?
I found this link 'https://knowledgebase.progress.com/articles/Article/Uploading-images-error-Cannot-save-the-file-The-type-initializer-for-Module-threw-an-exception' but unfortunately, this did not solve my issue.

Compiled Azure Function Monitoring: "No data available"

I'm using a couple of compiled C# functions on Azure. They are working as expected, but when I click 'Monitor' on either of the functions, it just shows up "No data available".
I can see the function running on the 'Develop' tab's log, but would like an overview of the function's usage.
Is there something I am missing?
I'm seeing these too. I compared a function app that is working with one that isn't working. The one that isn't working returns a 404 when I click "refresh" in the monitor tab. It's hitting an URL like this:
https://[YOUR_APP].scm.azurewebsites.net/azurejobs/api/functions/definitions//invocations?limit=20
Note the double slashes before "invocations".
In a working app, it's more like:
https://[YOUR_APP].scm.azurewebsites.net/azurejobs/api/functions/definitions/[YOUR_APP]-[YOUR_FUNCTION]/invocations?limit=20
So something has happened to blow up the [YOUR_APP]-[YOUR_FUNCTION] part of the URL that the portal generates. Any ideas?
--
UPDATE: I think I fixed it.
I connected to the storage account associated with the function app using Microsoft Azure Storage Explorer. When I went to Tables > AzureWebJobsHostLogscommon, I noticed two things:
there was an entry for a function I had deleted
there was a function that I had created that had no entry (well, it existed in the "default-[YOUR_FUNCTION]" RowKey, but the "[YOUR_APP]-[YOUR_FUNCTION]" RowKey was missing
I added a new row for the missing "[YOUR_APP]-[YOUR_FUNCTION]" RowKey and set the OriginalName to the real function name. I went back to the portal, and poof! it started working.
I didn't bother deleting the extraneous entry from the deleted function. It didn't seem to hurt anything. But if any real function is missing, it seems to break the whole Monitor tab.
How it got that way, I'm not sure. Maybe it was doing something when I published an update.
--
UPDATE 2: Well, that got the Monitor tab working, but the data is "stale", as if someone background process isn't refreshing. I can see the log data appearing in Table Storage...
--
UPDATE 3: The stale data seems to be separate issue in the East US region, tracked at https://github.com/Azure/Azure-Functions/issues/259 ... the "no data available" issue I think was fixed by me correcting the AzureWebJobsHostLogscommon table as mentioned above.
We believe we have found an issue when explicit host ids are set in the host file, which is what is likely causing the problem.
We're tracking this issue here and will update it as we make progress.
As a workaround, please remove the id from your host.json file.
I also had the "No data available" problem. I solved it by adding an application setting that was missing: "FUNCTIONS_EXTENSION_VERSION": "~1"
Reference, David Ebbo comment on GitHub:
https://github.com/Azure/Azure-Functions/issues/259#issuecomment-300379674
Had the same issue, resolved it by emptying the host.json and making
"FUNCTIONS_EXTENSION_VERSION": "~3"

Enum parameter taking passing incorrect values in Visual Studio Asp.Net MVC

We have this very strange error in Asp.Net MVC 4 Razor whereby within the View, we have the following code:
#Html.InlineEditingContentText(CS.General_v4.Enums.HtmlTagName.Span, VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title, "weather-widget-title masterpage-widget-title")
InlineEditingContentText is an extension method which we have internally. The 2nd parameter being passed is an enumeration parameter and as you can see from above, the value is VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title. Now when you debug into the extension method InlineEditingContentText, the actual 2nd parameters being received is not VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title but VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Header_LoggedOutText which happens to be the next value of the ContentTextIdentifier enumeration after VisitGozo.Enums.VisitGozoEnums.ContentTextIdentifier.MasterPage_Weather_Title.
We are not assigning values to the enumerations and so their respective int values increment after each other automatically.
Strangely enough, if we load the exact same project on another workstation, this works fine.
Also, if we perform some changes to the View (like just add a whitespace) and save, this also works fine.
Any possible insight into why this strange issue is happening?
Edit #1: Also, when we uploaded the website on the deployment server, after compiling using same workstation, the error was carried over as well
Edit #2: 2013-10-22 > We are still getting this same problem, even when then deploying the files on the actual production server, such incorrect enum values are being carried over. The only way to solve the issue is to delete the Views from the server / locally, and re-overwriting them again. Any idea how we can solve this issue? We shouldn't be caching Views so can't really understand why this is happening? Would appreciate any form of help!
Most likely cached files have not been cleaned. It might happen occasionally.
If you use IIS delete corresponding Temporary ASP.NET folder. For example, if your project is 64bit Framwork 4.0 then path would be:
%WinDir%\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\
If you use IIS Express or similar you might need to stop it and start again.
Updating Razor file forced dynamic compilation and that solved the your issue.

"Invalid postback or callback argument" after new deployment

Recently deployed a project into production and have run into the "Invalid postback or callback argument" error. We haven't encountered this in testing at all and after some research have found that the problem occurs in the following situation:
Old version is published and accessed.
New version is published and accessed without clearing the Temporary Files.
Drop down is changed twice. (The first time everything works fine.)
The fix for the clients that have called in has been to clear their temporary internet files but this isn't the ideal fix. Can anyone think of a reason why this would be happening and stop happening after the temp files have been cleared?
BTW: The app is ASP.NET 3.5 written in C#. We're using a javascript call back in this particular control that's causing this issue.
We didn't want to use the "enableEventValidation=false" trick as this isn't a consistent issue. From pretty early on, we were able to fix the issue case by case by clearing the temp files.
After some more looking today it was suggested that we rename our js file and behold, the issue is resolved locally. Seems that each user has had our old js file stored.
As to why it was throwing the "Invalid Postback" rather than a javascript error, we're not sure. There are other ways of specifying the version number in the script tags but for now we opted for the rename.
Since you mentioned that you're using a javascript callback, this may be related to event validation. If that's so, there is a workaround for that problem which is adding the following line to web.config:
<pages enableEventValidation="false"/>
So that, event validation is disabled in your pages. To turn it off is not recommended for security reasons because it verifies that arguments are originated by the server control.
You can get detailed information here about why this error occurs.

Adding a second <%#Register %> line to my page causes Compilation Error

When I have just one <%#Register %> line in my page, it loads fine.
When I add a second one, it gives me this compilation error:
Compiler Error Message: CS0433: The
type 'ASP.test1_ascx' exists in both
'c:\Users\me\AppData\Local\Temp\Temporary
ASP.NET
Files\root\c2d75602\aae4f906\App_Web_dta-e2tq.dll'
and
'c:\Users\me\AppData\Local\Temp\Temporary
ASP.NET
Files\root\c2d75602\aae4f906\App_Web_layerwindow.ascx.cdcab7d2.zxul1sik.dll'
(slightly anonymized)
Any ideas?
EDIT: Additional information I just noticed: the line above the broken line in the YSOD said: [System.Diagnostics.DebuggerNonUserCodeAttribute()] When I searched for information on this, I found a page telling me to check to make sure I didn't have any open brackets I wasn't closing. Haven't found any yet, but this may be part of the issue.
EDIT: Argh. Just want to kill the computer at this point. After daughtkom suggested creating a new project to see if the code worked from scratch, I did that and it worked. I then decided to create a new control and copied the Test1 code into there... and then it started working. (No changes to Test1 or Default.aspx, just created Test1-2.ascx.) Then I added the link to Test2 into Default.aspx... and now it's giving me the same error, just with test2. And creating a Test2-2.ascx isn't fixing it this time.
Delete your temporary files or restart your webserver.
I ended up setting "<compilation batch="false">" in my web.config file, which fixed the issue. I found it from a MSDN article... somewhere. If I find the link again I'll post it.
check the class names in test1.ascx.cs and test2.ascx.cs.
check the Inherits attribute of test2.ascx
Delete all of the DLLs in the folder mentioned in the error message. Also, check to make sure that the code behind for test2.ascx.cs doesn't inherit from test1.

Categories

Resources