I wanted to try EF5 as described here: http://msdn.microsoft.com/en-us/data/jj193542
But as soon as
using (var db = new BloggingContext())
is reached an System.InvalidOperationException is thrown with additional details saying that "The type 'ConsoleApplication1.Program+Blog' was not mapped. Check that the type has not been explicitly excluded by using the Ignore method or NotMappedAttribute data annotation. Verify that the type was defined as a class, is not primitive, nested or generic, and does not inherit from EntityObject."
No database is created. I'm using VS 2012 Express for Windows Desktop and SQL Server 2012. The database explorer can connect to the local SQLExpress instance without problems.
Any ideas?
Cheers, mttmjapj
Okay, found the culprit. I unconsciously put the source for Blog and Post into the program class. Which obviously is nested and therefore can't work.
Related
I am trying to get the parent list of a file on Sharepoint online with .NET CSOM in c#. The code below works fine when I test it from a standalone c# app.
But when I call the exact same method via a com interop in c++, with the same parameters, I get an exception, "the specified object does not belong to a list". Exception is thrown after the ExecuteQuery()
But I KNOW it does, If I call the method with the exact same URL /sites/develop_apps/Shared Documents/subway/heynow(000640-9-9-2016 9-53-31 AM).PDF in a standalone c# app, I get no exception. And the "GetFileByServerRelativeUrl" seems to be working fine. It doesn't throw an exception anyway.
I've read articles about similar errors and they seem to have something to do with the url possibly. But I can't understand why the same params work in one context but not another.
Microsoft.SharePoint.Client.File thisFile =m_clientContext.Web.GetFileByServerRelativeUrl(fileRelativeUrl);
ListItem item = thisFile.ListItemAllFields;
m_clientContext.Load(item.ParentList);
m_clientContext.ExecuteQuery();
Fiddler trace of the error shows.
{
"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.5701.1202","ErrorInfo":{
"ErrorMessage":"The object specified does not belong to a
list.","ErrorValue":null,"TraceCorrelationId":"c616a29d-90ab-3000-b1de-17538058f3e4","ErrorCode":-2146232832,"ErrorTypeName":"Microsoft.SharePoint.SPException"
},"TraceCorrelationId":"c616a29d-90ab-3000-b1de-17538058f3e4"
By comparing the ClientContext.Url fields of the working app and failing production test, I noticed that the urls were different.
My test that was working had a url of "https://mysite.sharepoint.com/sites/develop_apps/" .
My production test that's failing its "https://mysite.sharepoint.com"
and I was doing all my list manipulation in a library off of "https://mysite.sharepoint.com/sites/develop_apps/"
I guess when doing work against lists, you need to be more specific when creating your clientContext in regards to the url.
I have been using GHUnit with it without any problem to test a library.
This library basically perform calls to an API and use CoreData to decrease the number of API calls.
Then, I decided to switch to XCTest:
Created the test Target
Created the test class
Tests runs fine! wheeee!!!
However anything I try to do that involves CoreData I get a error: EXC_BAD_ACCESS(code=EXC_i386_GPFLT)
It does not happens with GHUnit, it is the same code!
Also, it runs if I set the "Host Application".
I know that the error is related to trying to access an address that the code is not suppose to, but there's no more details.
I see that in the DatabaseManager the line:
NSString *modelPath = [bundle pathForResource:bundlePath ofType:#"momd"];
Returns nil, but, as I said it runs fine when using GHUnit
or simply using the library.
I feel like I am missing some property in the project settings.
I have added the log here:
https://gist.githubusercontent.com/wilsolutions/96e3ae1310ccae86d344/raw/03ea1dfcdab75fc215baaba9d07123bd2e915617/gistfile1.txt
tkx
I have an Orchard site with a SQL DB, when I try to access the site the following error happen:
Server Error in '/' Application.
None of the constructors found with 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'BodyLogic.Physicians.Services.PhysicianService' can be invoked with the available services and parameters: Cannot resolve parameter 'BodyLogic.LegacyDb.Services.Repositories.Physicians.IPhysicianRepository physicianRepository' of constructor 'Void .ctor(BodyLogic.LegacyDb.Services.Repositories.Physicians.IPhysicianRepository, BodyLogic.LegacyDb.Services.DtoConverters.IDtoConverter)'.
When I delete the "default" folder from App_Data/Sites/... and install a new Orchard everything runs perfectly, no exception and the modules are ok, but when I change the connection string to point to SQL Server again, the same exception happens again.
Any assistance in this matter will be highly appreciated,
Regards and thanks,
Alex.
It's not SQL Server that's causing the error, but corrupted data. There is a feature that should be enabled but is not. I bet it's this one: BodyLogic.LegacyDb.
You probably added a dependency to an already enabled feature, am I right? If so then what you see is the default behavior - Orchard won't auto enable the newly added dependency. You need to do that manually.
Feature enable/disable state is stored in the db table Settings_ShellFeatureStateRecord. To fix the error:
open it,
find a record with Name equal to BodyLogic.LegacyDb and
set both InstallState and EnableState values to Up
After you've done that
clear your App_Data/cache.dat,
restart the app pool and you're set.
ReSharper says "Check if 'UserHostAddress' is not null" when I'm accessing HttpContext.Current.Request.UserHostAddress (it is in a try/catch block).
Within another method get the following property from the request object:
HttpContext.Current.Request.RawUrl
How does ReSharper determine or "know" that Request cannot be null? Or Current? Or HttpContext?
Maybe it is a bad example with this framework object chain but I think you get the point.
R# uses its included External Annotations to provide these code annotations for types within the .NET Framework (like your mentioned ASP.NET classes).
The reason, why Jetbrains annotated for example HttpContext.Current as nullable is that in an console application (an application without HTTP context) HttpContext.Current returns null.
What I've done is broken the default 'Version' service on my WSO2 DSS, I tried to set the Scopes variable for WS-Discovery and didn't put a closing tag/element when creating the parameter.
Now when I try to access the parameters screen I get an xml Parse error
TID: [0] [WSO2 Data Services Server] [2012-08-22 12:38:04,404] ERROR {org.wso2.carbon.service.mgt.ServiceAdmin} - Error occured while getting parameters of service : Version
{org.wso2.carbon.service.mgt.ServiceAdmin}org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60) in end tag Expected '>'. at [row,col {unknown-source}]: [2,58] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296) at
I'm assuming this is stored in the H2 database, I've tried looking for the parameter in the .db file using notepad but I can't find it.
Is there another way to connect/browse the H2 db?
I've scanned through the repository, database and conf directories for clues without success.
UPDATE:
Yes you can connect to the H2 db using the included database Explorer under the Tools menu.
Use the connection details found in the repository/conf/registry.xml file
Then you can do SQL queries on it - (I haven't found the answer yet though)
UPDATE 2:
I don't think the parameters are held in the H2 db, but I managed to fix my problem by:
downloading the Version.aar file using the link on the list services page
deleting the Version service
Copying the Version.aar file into the repository/deployment/server/axis2services dir
I guess deleting the service removed any records/references to my broken parameter
I believe you've tried setting service parameters via the UI? Usually the service parameters you specify via the UI do not get saved in the services.xml of the original axis2 service archive. Instead, they get saved in the registry that is shipped with DSS and get applied to the service at runtime. But if you specify a malformed parameter then wouldn't be saved in the registry instead, throwing an exception while trying to engage that parameter. So there'll be no record saved corresponding to that kind of malformed parameters.
Hope this helps!
Cheers,
Prabath