Sitecore content editor will not load - c#

A bad assembly or sublayout has been added to our Sitecore environment resulting in the content editor area being gray with no items to click on...
Here's what I've done..
Deleted all custom sublayouts with their assemblies from the date in question.
Cleared the website/temp folder.
Refreshed IIS site & did a recycle on app pool & IIS reset.
UPDATE: Most js errors seem to be uncaught reference errors..
Still cannot get the content editor to appear. No errors in log.
Please advise..

I've seen this before, I would check to see if you have a Microsoft AJAX dll in your bin, and if you don't need it you should get rid of it and all references to it.

Are you able to connect a clean Sitecore installation to your database? If you also experience the problem with the clean installation, then it is likely something that was changed at the database level that is giving you a problem.

Related

C# Couldn't process file xxx.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file

I have an issue while I try to build project in VS2012.
It cannot build due to the error:
Couldn't process file xxx.resx due to its being in the Internet or Restricted
zone or having the mark of the web on the file. Remove the mark of the web if
you want to process these files.
Here is a similar question.
but I tried that option and had no luck, because I did not download the file from the internet. That project was built from scratch. In project after selecting Properties, in Windows Explorer nothing happened. I do not have the "unblock" option, only the default three options (read only, hidden, and archived).
I have the same error and cannot build or rebuild the project. I have a theory that it is a recent error after updating Windows. Before the update, everything worked fine. Any ideas?
Go to xxx.resx file in Windows File Explorer. Right-click and select properties. At the bottom of the the dialog is an "unblock" option:
Check this and click Apply. Clean your solution and it will build.
In my case I had the same problem with many files.
My solution with VS Prof. 2017 V15.95 was:
Open powershell and execute dir -Path [directory path] -Recurse | Unblock-File
Rebuild all
On the solution folders locate abc.resx.
Open the file using any text editor, preferably Notepad++.
Locate and delete any node starting with <data
Example. This is what you should delete.
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAMAICAAAAEAIACoEAAANgAAAGBgAAABACAAqJQAAN4QAACAgAAAAQAgACgIAQCGpQAAKAAAACAA
AABAAAAAAQAgAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
///////////8AAB/////////
</value>
</data>
Reload or reopen your solution and build. You are ready to go.
Had the same problem after updating to VS 2017 v15.8.5, and none of the solutions above or on other forums worked for me.
So, since a .resx file is just XML, I just copied the content, deleted the original file and recreated it with the copied content.
That was the only thing that worked, and it worked first time.
A quick way to remove this mark of the web for multiple files and folders recursively for me was to
Zip them up.
Delete originals.
Unzip.
I'm not really sure either, I have the exact same issue.
But, what i did, was hit view in file explorer.
Then, i clicked show hidden items.
Finally, i went back to my folder and clicked on the .vs folder, my project/file name, v15, Server, sqlite3, and deleted DB.Lock.
I reopened the project, clicked build, and it worked perfectly.
This worked for me, it might/might not for you.
I also encountered this issue recently. The error began occurring after I set the icon of a Windows Form.
Researching for the cause and solution almost led me nowhere, because I did not download the icon from the internet, nor was I referencing a web-based icon file. It was stored entirely on my local machine.
After some more researching and digging around, I was able to figure out exactly what was causing the problem. I have Microsoft One-Drive installed on my machine. The directory in which the icon file was located is managed/synced by One-Drive. That fact was somehow tricking Visual Studio into believing the file was located or downloaded from the internet.
The solution proved to be very simple. I removed the icon from the form, as well as from the corresponding .resx file. Then I moved the icon file to another directory not associated with One-Drive. Finally, I was able to use that icon in my Windows Forms application without getting this error.
I understand there are other possible causes for this error. But if in your case, the issue happened after setting a form's icon--and if you have One-Drive (or perhaps another cloud-based storage solution) installed--then check to be sure that icon file is not in a directory managed by that service. If so, relocate it and change the form's icon property to point to the new location.
To fix this for multiple files within a project, Visual Studio -> Tools -> Options -> Trust Settings and add the project path as a trusted path.
Using VS 2019, and building against source stored on an Azure shared file system. I think I may have just tracked down a work-around, and it has to do with the Icon as referenced above by Jake above. If I add the icon to the form's resource file (that really long string), The error occurs.
However, if I add the Icon to the Project's resources, delete the Icon from the form's resource file, and change form to set the Icon manually...
this.Icon = MyProjectName.Properties.Resources.MyIcon;
The error goes away.
I found this solution on another forum. My project resided on a file share, so I had to enter file://[file share] for Step 4 below. I am running VS2019 on Windows 10.
Start Menu > type 'Internet Options'.
Select Local intranet zone on the Security tab then click the Sites button
Click Advanced button
Enter file://[computer name] or file://[file share]
Make sure 'Require server verification...' is unticked
I had the same issue in Windows 10 VS 2019 16.4.457 (previous version of VS 2019 had no problems).
The "marked for web" error shows only after I moved the project under One-Drive.
If I move the project back to a local drive the error doesn't show.
As Anthony Gingrich suggested, I tried to move the project images to a local directory without success.
The solution that works for me was, for each image, in the "Select Resource dialog" use "Project resource file" instead "Local resouce".
Please guys, I already fixed the issue, this is cause by OneDrive, please close your OneDrive with the use of task manager or close the icon OneDrive's Hidden Icons on the taskbar
I just ran into the same issue and also tried the Unblock option from explorer with no luck. I even restarted VS with no luck.
However, I'm not sure which combination did the trick but I opened the form as well as the resx file from within VS, just to see if I can open it, which opened fine. I then did a clean and rebuild and that appeared to do the trick. If it doesn't try restarting VS after the clean then rebuild.
I had a similar issue and the problem was an image that I had downloaded and added to my Resources. Not completely sure why that was the only image that gave me problems, however, I opened my abc.resx file giving me issues an a text editor, removed the node starting with " (it was the last and only node) just like Albert Alberto mentioned. Saved the changed, cleaned and rebuilt my solution and it all works! The image didn't render but it only took a second to go back and add the image. It wasn't removing the entire file, just the node that was causing the issue.
I had the same problem on Windows 10, VS 2017 (15.9.13). I sent myself a project from work through Dropbox so I could try a couple of things from home. But when I tried to build it VS gave me the 'marked for web' error.
After trying the solutions above without success I began experimenting. I was able to solve this by using the method listed above (right click -> properties -> unblock), but I had to do it for each of the images in the Resource folder--and I had to do EACH FILE individually since the 'unblock' option was not available on group-selects. I actually unblocked each source file in the project as well before trying to rebuild so I am not sure if both are required.
Its a bit of a pain--probably a huge pain for larger projects--but it absolutely got the project building again.
EDIT: I did find this article afterwards about unblocking entire folders--even recursively but have not tried it: https://www.winhelponline.com/blog/bulk-unblock-files-downloaded-internet/
None of these worked for me. I fixed it by converting the embedded base64 into a linked resource:
I found out the issue was with the embedded base64 image I had in the .resx (as the issue went away removing the data tag as explained in this question but that meant I removed the image) so I converted the embedded image into a .png file and made a link to that in the .resx.
To do that: open the .resx file in Visual Studio 2019 and double-click the image, and then click Ok and Yes in the following prompts that will appear so VS will convert the embedded image into a linked resource (sorry I can't upload pictures yet):
Hope it helps!
From my original comment.

ASP.Net 5/MVC6 Razor views not updating with changes in browser unless I restart IIS Express

I currently have an MVC6/ASP.Net 5 project. I "start without debugging" and the app loads in the browser. I can make changes to .cs files and recompile and they show in the app.
However, when I make any changes to razor files (*.cshtml) they don't show at all. I have to kill IIS express and re-launch in order to get the change to show. The rest of my team is working on the same code base/solution and it is working fine for them.
I have updated to VS SP1, and re-installed the tooling. No luck.
Please help!
Most probably you have the .csproj MvcBuildViews property set to true. To check, unload the project (right-click it) and then edit it with the text editor.
The property gets rid of the "lag on first visit of view", but increases build times (and startup times) as well as introducing situations like this.
If you have it enabled, only enabling the property on Release (and not Debug) configurations might help:
Replace the <MvcBuildViews>true</MvcBuildViews> with the following:
<MvcBuildViews Condition="'$(Configuration)'=='Debug'">false</MvcBuildViews>
<MvcBuildViews Condition="'$(Configuration)'=='Release'">true</MvcBuildViews>
---------- EDIT ---------
Actually, sometimes this is not enough. Most probably (after the one above), you have the optimizeCompilations="true" attribute set on the <compilation> element inside <system.web> in your web.config.
If you don't want to remove that, you can periodically remove all the contents of this folder: %localappdata%\Temp\Temporary ASP.NET Files\vs (yes, you can enter that directly into the file explorer address bar)
Also, try the suggestion in my OP-comment:
A temporary rescue is to add a cache-buster to the browsed URL
(?nocache=1, 2 etc) and at the same time introduce a Razor c# syntax
error. Then, after reloading, remove the syntax error and the page
will be reloaded...
I had the same issue.
Closing Visual Studio and deleting .vs folder in the solution directory worked for me.
I think my IIS Express's configuration was corrupted. This may be why it worked for me.
It's a bug, and I found an answer to this that solves it here on StyackOverflow.
Other Stack article here
Try clearing out your IISExpress cache / application space:
https://gyorgybalassy.wordpress.com/2013/12/02/cleaning-up-iis-express-configuration/
It's worked wonders for me before.

ASPNETCOMPILER(0,0): Error ASPRUNTIME: Object reference not set to an instance of an object

I'm Trying to publish a website, using Visual Studio 2013.
I'm getting an error:
ASPNETCOMPILER(0,0): Error ASPRUNTIME: Object reference not set to an instance of an object.
It happens also on Visual Studio 2010.
I tried to restart VS, and PC.
I removed *.dll.refresh from my bin directory.
I don't have <clear/> tags in my web.config.
I think it all started when I accidently removed my *.suo file.
Any ideas?
Update:
I just noticed it happens only when I try to precompile my site. If I publish without precompilation it works fine...
I also had this problem and it was not solved by any of the ideas mentioned previously. The problem was that somehow compresssion had been enabled on the subfolder of my drive containing the ASP.NET website. The solution is to right-click, choose properties and in the general tab, click Advanced and under the 'Compress or Encrypt attributes' section, make sure 'Compress contents to save disk space' is unchecked. Upon prompting do this for all files and subfolders (note it may take some time). Hope this helps someone.
OK.
After wasting so many hours I somehow got to this blog:
http://thesoftwarepractice.net/development-things/object-reference-not-set-to-an-instance-of-an-object
Turned off the McAfee Real Time Scanning and its works...
This is a hard to catch issues, which usually comes with webforms aspx pages.
If you are deploying the app with pre-compiled option and you have selected the "Do not merge, create a separate assembly for each page and control" here:
then you need to make sure that there are no compiled assemblies for any of the aspx pages in the bin folder of the project you are trying to compile. Go to your bin folder and delete any assemblies related to your web pages and try publishing again. This will fix this issue.
Have you tried creating a new website, adding all the files from old website to the new one and adding all the references used?
I also had this issue, and I fixed it by clearing and re-configuring all the dependencies and the dll's of the project.
I have deleted files from bin folder and then build solution and publish application.
It works for me.
In my case was only failing from commandline (msbuild), and from CI agents. The solution I've found is to disable the check "Allow precompiled site to be updatable in Project->Page Properties->MsBuild

Seeing file changes in the browser without rebuilding your project

I am a Front-end developer, currently working on a .net project. It was explained to me that some of the resources of the project are embedded and when I say some, I mean most of them. Therefor when making changes in the files, you can't see them in the browser without first re-running the project from Visual studio.
I believe you see how this is extremely annoying and frustrating to me. I am used to more dynamic way of working, even have something like livereload running to inject my styles and refresh the page when markup has changes, so I can see the changes in the browser without even switching the active window
I was wondering if there is anything even remotely close to what I am used to as a workflow for web development
Files including aspx and cshtml can be saved (most of the time) and will show changes upon page refresh. Occasionally, the file system may access the files and overwrite them. Files that are compiled upon build are not able to be changed unless a rebuild is issued.
In short terms, front-end is easily edited during run while code-behind and classes cannot.
You've tagged this as MVC, so that means if the view is changed it can be reloaded without running it from Visual Studio. Further, the project just needs rebuilt if you change code. You don't have to re-run it from Visual Studio.
So, in short, you can certainly still make changes in the browser with livereoload, then move those CSS changes to the CSS files in the application, and refresh your browser. That's it.
EDIT: After seeing the screenshot, change that to Content instead of Embedded.

DotNetNuke custom module doesn't load images or CSS

I have a localhost install of DotNetNuke 6.2.6 with a custom module.
The problem is that any images or css contained in the module.css file does not load. Firebug reports an 500 Internal Server error when retrieving the images or the module.css files.
My image tag is:
"< asp:Image ID="DeleteButton" ImageUrl="~/DesktopModules/PositionsManagement/images/delete.gif" runat="server" / >"
The web browser displays a broken image icon whose properties point to
http://localhost/dotnetnuke/DesktopModules/PositionsManagement/images/delete.gif
When I try to navigate to the above link I get hit with the following error message:
The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the element of the Web.config file.
And when I remove the targetframework attribute like it suggests I get this:
*Parser Error Message: The code subdirectory '/dotnetnuke/DesktopModules/PositionsManagement/App_Code/RazorHelpers/' does not exist.*
Does anyone know what the problem is or how I get the RazorHelpers content it seems to be wanting?
Take a look in IIS Manager.
I got this error and resolved it by deleting the application created on the folder of the module in error.
I don't know why this folder was converted in application.
Seems DNN doesn't play nice with Windows 8, Visual Studio 2012 and SQL Server 2012. Whether it's Win8, or some combination of all of them, I have no idea.
I rectified the problem by creating a Windows 7 virtual Machine.
EDIT: With some local assistance, it seems that deleting the modules web.config file and cleaning up my Web APplications in the App Pool helped. (I had it in there twice somehow, at localhost/dotnetnuke/etc and localhost/dnn/etc. After cleaning up and deleting the web.config it started working again.

Categories