SharePoint error: "File Not Found" - sharepoint-2007

I have an ASP.NET 2.0 web project that lives within SharePoint 2007. A couple of days ago, I made two changes to several pages, the first change was to adding a script reference to a jQuery file inside of my script folder that I lives with in my web project.
The second change was where I replace all of my DatePicker controls from SharePoint's DateTime control and I had to add a <% Register....SharePoint.WebControls reference at the top of this one page.
After I have compiled the solution in release mode and deployed out to my production environment, I started to get a "File Not Found" error when I try to access the page from SharePoint. I have no idea what's going on. We have recycle the app pool and even the stack trace doesn't tell use that much. Below is a view of the stack trace that I received when accessing the page. Please help, I've been looking at this issue for days now.
File Not Found. at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Signature..ctor(RuntimeFieldHandle fieldHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Reflection.RtFieldInfo.get_FieldType()
at System.Web.UI.Util.GetNonPrivateFieldType(Type classType, String fieldName)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildFieldDeclaration(ControlBuilder builder)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse)
at System.Web.Compilation.TemplateControlCodeDomTreeGenerator.BuildMiscClassMembers()
at System.Web.Compilation.PageCodeDomTreeGenerator.BuildMiscClassMembers()
at System.Web.Compilation.BaseCodeDomTreeGenerator.BuildSourceDataTree()
at System.Web.Compilation.BaseTemplateBuildProvider.GenerateCode(AssemblyBuilder assemblyBuilder)
at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider)

That's a familiar one. It's related to the version of System.Web.Extensions that's requested by the SharePoint DateTime control. It seems that it is using Ajax and you aren't referencing the right Ajax platform version.
Steps similar to the ones described here solved my problem:
http://paulsiu.wordpress.com/2009/03/04/file-not-found-error-when-you-select-new-webpart-after-installing-smartpart-13/

Related

error in running transformation:indexoutofrangeexception - petapeco

as per suggestion for by #CreativeManix I started investigating petaPeco
Retrieving large number of rows (more than 10 mil) in asp.net mvc application
After adding exact system.data.oracleclient + putting web.config in the bin where mvc is getting compiled in .dll I got following error:
Error 3
Running transformation: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Array.InternalGetReference(Void* elemRef, Int32 rank, Int32* pIndices)
at System.Array.GetValue(Int32 index)
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.GetCurrentProject()
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.GetConnectionString(String& connectionStringName, String& providerName)
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.InitConnectionString()
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.LoadTables()
at Microsoft.VisualStudio.TextTemplating5F4490FB7AE018243DBB4DF6250E7211.GeneratedTextTransformation.TransformText()
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)
This error shows up when i run the transformation after installation of petaPoco.
One thing I do know the error is coming from "GetCurrentProject" - and probably - "(Array)dte.ActiveSolutionProjects"
I think something is wrong in the way petaPoco is set up with my project! somehow it can't find the activesolution project. I am not too sure how to fix it.
I investigated this.
In my question section I asked few questions:
I was not sure about how to fire transformation/or process of generating Database.CS. So initially I was installing petapoco from the command prompt- I
To do that you just click "Run Custom Tool" by right clicking on the "Database.tt". If your connection string is correct + you are referencing correct Oracle/SQL server data provider + that provider is available in GAC + (if it is oracle and you have the password for the default schema user of the database you are trying to access)- then that should generate the Database.cs
To enable Oracle data client to read the schema out of oracle database I needed to take out following entry:
cmd.GetType().GetProperty("BindByName").SetValue(cmd, true, null);
And everything worked.
Connection string can look like:
connectionString="Data Source=PXWREG;Persist Security Info=True;User ID=XWREG_ACDS_T;password=isacdst"

Opening the 'Insert image' modal in Umbraco 6.1.3 causes NullReferenceException

When I hit the 'Insert image' button in the rich text editor bar, the modal opens but then an error page appears:
Details of exception: System.NullReferenceException: Object reference not set to an instance of an object
Stacktrace:
[NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.]
umbraco.controls.Images.ImageViewer.OnPreRender(EventArgs e) +70
System.Web.UI.Control.PreRenderRecursiveInternal() +83
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
Versiondata: Microsoft .NET Framework Versie:4.0.30319; ASP.NET Versie:4.0.30319.17929
Running Umbraco 6.1.3 on localhost and on server, both give the error.
I have already tried to replace the umbraco.dll and umbraco.editorControls.dll with fresh ones, but to no avail.
I also checked all my datatypes, but none are corrupt (as per Rich Text Editor and Inserting Images getting error and http://our.umbraco.org/forum/using/ui-questions/39103-Problem-with-Rich-Text-Editor-and-Inserting-Images).
I am using uComponents, but I have the most recent version (5.5.0)
If this is an update from a previous version, check that the configuration settings are all present, especially any specific to the media folder. It sounds like a setting just isn't present.
Also, often I forget to "include" all the files in my visual studio project too, so when I do a publish, any new files don't get included.
I got this error when I upgraded an install from v6.1.1 to v6.1.6. Although the offcial instructions state that only the bin folder needs to be updated this is far from being the case. You also need to ensure you use the latest files under /Umbraco and also /Umbraco_client. If you check the namespaces in /Umbraco/Controls/Images, for example you'll see it now lives in a different namespace
'<%# Control Language="C#" AutoEventWireup="True" CodeBehind="ImageViewer.ascx.cs" Inherits="Umbraco.Web.UI.Umbraco.Controls.Images ... %>
to the original:
'<%# Control Language="C#" AutoEventWireup="true" CodeBehind="ImageViewer.ascx.cs" Inherits="umbraco.controls.Images.ImageViewer" %>'
I've been working with Umbraco for just over six months and in that time I've yet to see a document from them that is accurate or complete. FFS.

Cannot Insert image through Umbraco RichText editor

The problem regarding richtext editor in Umbraco 4.
I am not able to add images through the RichText editor. When i click on the add image icon on the rich text editor, the popup panel displays an error (find in resource number 2).
The RichText editor datatype is using Tinymce3 as its type.
The resources ihave used and did not solve the problem.
1) http://our.umbraco.org/forum/using/ui-questions/39103-Problem-with-Rich-Text-Editor-and-Inserting-Images
2) Rich Text Editor and Inserting Images getting error
What i have done(they did not work):
a) resaved the RichText editor datatype with different Type,
b) deleted the RichText editor(bad mistake) and recreated it,
c) copied the code of insertimage.aspx from different projects wherever the RichText editor is working,
Kindly, have a look at the error image i have attached with this question.
Any suggestion would be helpful.
Error
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
[No relevant source lines]
Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_uploadmediaimage.ascx.c3c18f9f.5y91thdt.0.cs Line: 0
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.cms.businesslogic.datatype.DataTypeDefinition.b__0(DataTypeDefinition x) +235
System.Linq.WhereArrayIterator`1.MoveNext() +42
umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetByDataTypeId(Guid DataTypeId) +311
umbraco.controls.Images.UploadMediaImage..ctor() +88
ASP.umbraco_controls_images_uploadmediaimage_ascx..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_uploadmediaimage.ascx.c3c18f9f.5y91thdt.0.cs:0
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlMediaUploader() in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:187
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlpane_upload() in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:186
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlForm1() in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:150
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlTree(umbraco_plugins_tinymce3_insertimage_aspx __ctrl) in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:1
ASP.umbraco_plugins_tinymce3_insertimage_aspx.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_insertimage.aspx.43b758d9.qhb5uafm.0.cs:0
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +67
System.Web.UI.Page.ProcessRequest() +118
System.Web.UI.Page.ProcessRequest(HttpContext context) +98
ASP.umbraco_plugins_tinymce3_insertimage_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_insertimage.aspx.43b758d9.qhb5uafm.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +912
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033
Two things that spring to mind:
Permissions
I would do the usual housekeeping check first. Ensure that the following accounts have modify permission on all of the site's folders:
NETWORK SERVICE
IUSR
IIS_IUSRS
Corrupted install
A final resort would be a re-install. Copy over all the files from your version of Umbraco. If this still doesn't work, point it at a new database and try re-installing a basic Umbraco website.
The idea here is to determine if it is a corrupted database record, or a missing/corrupted file.
Is the site a new one? Have you always stuck with the same version or recently upgraded?
Let us know if you have your own answer too please. Best of luck!

protobuf-net transcoder for EnyimMemcached problems

Is the transcoder from protobuf-net to enyim cache deprecated? distributed caching with protobuff-net
Setting my Enyim config just like this app.config causes an error when I try to start the MemcachedClient()
The same for using
transcoder type="ProtoBuf.Caching.Enyim.NetTranscoder"/
System.TypeInitializationException was unhandled by user code
HResult=-2146233036
Message=The type initializer for 'Enyim.Caching.MemcachedClient' threw an exception.
Source=Enyim.Caching
TypeName=Enyim.Caching.MemcachedClient
StackTrace:
at Enyim.Caching.MemcachedClient..ctor()
at Global.asax.cs:line 31
InnerException: System.Configuration.ConfigurationErrorsException
HResult=-2146232062
Message=The value of the property 'transcoder' cannot be parsed. The error is: Object reference not set to an instance of an object. (\web.config line 207)
Source=System.Configuration
BareMessage=The value of the property 'transcoder' cannot be parsed. The error is: Object reference not set to an instance of an object.
StackTrace:
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.HttpContext.GetSection(String sectionName)
at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName)
at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at Enyim.Caching.MemcachedClient..cctor() in MemcachedClient.cs:line 25
InnerException:
Both installed via nuget and using the latest version available.
Yes (cough), of course that's there! Just see "protobuf-net.Enyim", i.e.
PM> Install-Package protobuf-net.Enyim
(or use the GUI client)
To initialize, you need to configure the transcoder to be an instance of ProtoBuf.Caching.Enyim.NetTranscoder (as per the original instructions). If you are doing this via configuration, note that the assembly for this type is now protobuf-net.Enyim. If I assume the configuration file uses standard notation, then that means you would need to specify (in the config):
<transcoder type="ProtoBuf.Caching.Enyim.NetTranscoder,protobuf-net.Enyim" />
Original answer:
The enyim transcoder is not currently in nuget; however - I will right now take it upon myself to resurrect that, by adding a separate NuGet package (reference EnyimMemcached and protobuf-net) that adds this back in.
Random question... any chance you can point me at a binary memcached download for testing?
One reason this has lagged is that when I first wrote the enyim transcoder, memcached was a simple "run this" - but last time I looked it had gone all "enterprisey", and I couldn't track down a simple package that just had the memcached server. If you can show me where that is now, I'll get it working this weekend.

Why is EF4 trying to re-create my database even though the model hasn't changed?

I have an ASP.NET MVC 3 Beta website using SQL Server CE 4.0. With both ScottGu's NerdDinner example and my own code, I will sometimes get the following exception as soon as I try to access the database:
File already exists. Try using a different database name.
[ File name = D:\Sourcecode\NerdDinner\NerdDinner\App_Data\NerdDinners.sdf ]
Line 17: public ActionResult Index()
Line 18: {
Line 19: var dinners = from d in nerdDinners.Dinners
Line 20: where d.EventDate > DateTime.Now
Line 21: select d;
[SqlCeException (0x80004005): File already exists. Try using a different database name. [ File name = D:\Sourcecode\NerdDinner\NerdDinner\App_Data\NerdDinners.sdf ]]
System.Data.SqlServerCe.SqlCeEngine.ProcessResults(IntPtr pError, Int32 hr) +92
System.Data.SqlServerCe.SqlCeEngine.CreateDatabase() +1584
System.Data.SqlServerCe.SqlCeProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 timeOut, StoreItemCollection storeItemCollection) +287
System.Data.Objects.ObjectContext.CreateDatabase() +84
System.Data.Entity.Internal.DatabaseOperations.Create(ObjectContext objectContext) +35
System.Data.Entity.Infrastructure.Database.Create() +70
System.Data.Entity.Infrastructure.CreateDatabaseOnlyIfNotExists`1.InitializeDatabase(TContext context) +360
System.Data.Entity.Infrastructure.Database.Initialize() +272
System.Data.Entity.Internal.InternalContext.Initialize() +90
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +34
System.Data.Entity.Internal.Linq.EfInternalQuery`1.Initialize() +140
System.Data.Entity.Internal.Linq.EfInternalQuery`1.get_Provider() +29
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +34
System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +63
NerdDinner.Controllers.HomeController.Index() in D:\Sourcecode\NerdDinner\NerdDinner\Controllers\HomeController.cs:19
I cannot figure out why this works sometimes with an existing .dbf file and other times it complains. I have even tried explicitly setting the default behaviour with
Database.SetInitializer(new CreateDatabaseOnlyIfNotExists<...>());
Has anyone else experienced this?
Restarting Cassini doesn't seem to make a difference.
Hitting refresh in IE after receiving this error will make the exact same page load properly.
Sorry to resurrect such an old question, but I was experiencing this today and have found a workaround which does not involve installing an older version of the CTP.
From The correct url for the blogpost is http://www.hanselman.com/blog/PDC10BuildingABlogWithMicrosoftUnnamedPackageOfWebLove.aspx (about half-way through the blog post)
*Go into your AppStart_SQLCEEntityFramework.cs file and the DefaultConnectionFactory line to this:*
Database.DefaultConnectionFactory = new SqlCeConnectionFactory(
"System.Data.SqlServerCe.4.0",
HostingEnvironment.MapPath("~/App_Data/"),"");
My particular database is placed in the App_Data folder but I'm assuming that if yours is not you should be able to change the path to suit and it will work.
Hope this helps!
It looks like this is a recently discovered bug.
MSDN Forum
The workaround is to re-install SQL Server CE 4.0 CTP 1 download
Install and use SQL Server CE CTP1, which is still downloadable on Microsoft sites. This solved my problem with that.
I had the same problem today with released MVC3 and SQL Server CE 4.0 downloaded with NuGet and it was resolved by uncommenting the line:
DbDatabase.SetInitializer(new CreateCeDatabaseIfNotExists<MyContext>());
And replacing MyContext with the context class that was inheriting from DBContext in the models folder.
The final SQL Compact Edition 4.0 is out and after installing it the issue is not happening anymore. Here is the announcement from the team blog:
Microsoft SQL Server Compact 4.0 is available for download

Resources