Entity Framework Error System.__ComObject to EnvDTE.ProjectItem - visual-studio-2010

I tried to add some entities from my db to my Model.tt and I couldn't do it.
the project doesn't recognize the entities and there aren't appear inside of my Model.tt, but the are in the folder of my project.
When I try to add the new tables/entities I got this error:
Ejecutando transformación: System.InvalidCastException: No se puede convertir el objeto COM del tipo 'System.__ComObject' al tipo de interfaz 'EnvDTE.ProjectItem'. Ocurrió un error de operación debido a que la llamada QueryInterface en el componente COM para la interfaz con IID '{0B48100A-473E-433C-AB8F-66B9739AB620}' generó el siguiente error: Error al cargar la biblioteca de tipo/DLL. (Excepción de HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).
Server stack trace:
en System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, Boolean& pfNeedsRelease)
en EnvDTE.ProjectItem.get_FileNames(Int16 index)
en Microsoft.VisualStudio.TextTemplatingEC2717411E6FD5E7E265CE923A7190B6.GeneratedTextTransformation.EntityFrameworkTemplateFileManager.VsEntityFrameworkTemplateFileManager.ProjectSync(ProjectItem templateProjectItem, IEnumerable`1 keepFileNames)
en Microsoft.VisualStudio.TextTemplatingEC2717411E6FD5E7E265CE923A7190B6.GeneratedTextTransformation.EntityFrameworkTemplateFileManager.VsEntityFrameworkTemplateFileManager.<.ctor>b__3c(IEnumerable`1 keepFileNames)
en System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
en System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Exception rethrown at [0]:
en System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
en System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
en System.Action`1.EndInvoke(IAsyncResult result)
en Microsoft.VisualStudio.TextTemplatingEC2717411E6FD5E7E265CE923A7190B6.GeneratedTextTransformation.EntityFrameworkTemplateFileManager.VsEntityFrameworkTemplateFileManager.Process(Boolean split)
en Microsoft.VisualStudio.TextTemplatingEC2717411E6FD5E7E265CE923A7190B6.GeneratedTextTransformation.TransformText()
en Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)
Any clue will be of great help!!
Thanks.

Related

How do I set the Icon of the RemoteNotification in GeneXus 15

I've been trying to set an icon for a RemoteNotification, but always get this error when I send it (I'm using log4net):
System.Reflection.TargetInvocationException: Uma exceção foi acionada pelo destino de uma chamada. ---> System.NullReferenceException: Referência de objeto não definida para uma instância de um objeto.
em GeneXus.Utils.GXDbFile.PathToUrl(String path)
em GeneXus.Programs.aenvianotificacaodispositivo.S121()
em GeneXus.Programs.aenvianotificacaodispositivo.executePrivate()
em GeneXus.Programs.aenvianotificacaodispositivo.execute()
I couldn't find any example in the wiki or in the forums. That's my code:
//commented also didn't work
//&Image.FromUrl('http://www.example.com/my_app_icon.png')
//&Image.FromUrl(app_icon_notif.Link())
&Image.FromImage(app_icon_notif)
&RemoteNotification.Icon = &Image
&RemoteNotification.Message = &NotificMensagem
&RemoteNotification.Event.Name = 'Notas'
&RemoteNotification.Event.Execution = EventExecution.OnLauchByUser
&Notifications.Add(&RemoteNotification)
What am I missing? I'm on GeneXus 15 U2 C#. Thank you
The notification icon is set by the Android Notification Icon property of the main object.
The corresponding imagen needs to follow some considerations mentioned here

Bot Framework Formflow EnumSelectOne template doesn't work on telegram

I'm facing a problem using FormFlow feature.
My model has the propertie below:
[Describe("Site")]
[Template(TemplateUsage.EnumSelectOne, "Em qual {&} será feita a reserva? {||}", ChoiceStyle = ChoiceStyleOptions.Default]
[Template(TemplateUsage.NotUnderstood, "Não entendi sua resposta... você precisa me informar o nome de um site válido ou ainda pode clicar num dos botões acima")]
public Site? Site { get; set; }
Site is a enum, and it renders a list of buttons. It works properly on webchat but not in Telegram.
When the user select an option in webchat, the answer is prompted below and the bot continue the dialog. However, in telegram, the user select an option and the answer is not prompted on the chat and the framework stay waiting a user interaction.
Can anyone help me with this issue?
Tks in advance.
I solved the question... To work properly on telegram you need to put ChoiceStyle = ChoiceStyleOptions.Auto on Template attribute.
Here the whole property configuration:
[Describe("Tipo de solicitante")]
[Template(TemplateUsage.EnumSelectOne, "Que {&} você é? {||}", ChoiceStyle = ChoiceStyleOptions.Auto)]
[Template(TemplateUsage.NotUnderstood, "Não entendi sua resposta... você precisa me informar se é funcionário ou terceiro ou ainda pode clicar num dos botões acima")]
public TipoSolicitante? TipoSolicitante { get; set; }

Team foundation server doesn't connect

I'm trying to connect to tfs in visual studio 2015 and it gives this error message when i click ok,it gives me this exception
Image :
Which means in english: The parameter is not in the expected range.
Orignal Stack Track:
System.NullReferenceException: La référence d'objet n'est pas définie
à une instance d'un objet. à
Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid&
packageGuid, Int32 reason, Guid& context) à
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
à
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
Translated Stack Track:
System.NullReferenceException: Object reference not set to an instance of an object. at
Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid&
packageGuid, Int32 reason, Guid& context) at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
at
Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()

$this->params['prefix'] is detected only if $_SESSION values exists

At the moment I'm using Cakephp...
This webpage contains an admin section and a "normal" section... you can access to the admin section using "...site/admin".
If the user writes in the url "...site/admin" then it's suppossed to be redirected to an admin logon section...
However, if he tries to go to the "site" directly, then he will also be redirected to another logon section but for access to the normal site.
The problem is... my code is not working... if I try to access to the admin site, then I'm redirected to the normal logon section and I must write my credentials... then after that, I'm able to go to the admin site (and prompted for admin credentials, which is ok)
If all of this sounds confusing, you have to know that:
Administrator section -> needs admin credentials
Normal section -> needs normal credentials
but this is what's happening right now:
Administrator section -> needs admin credentials -> needs normal credentials
This is the code, it's located on AppController (the program heads directly to redirect(site.com) and I don't understand why)
function beforeFilter()
{
session_start();
if($this->params['prefix'] == 'admin'){ //Si se quiere ir a la sección de admin...
if($this->Session->check('Admin.logged')){ //si esta logueado...
$this->layout = 'admin'; //Pone el layout de admin
}else{ //Si no esta logeado un admin...
$this->redirect(array('controller'=>'info','action'=>'login','admin'=>false)); //lo redirige al login.
}
}
else //si no está en admin, está en todas las demás páginas, a las cuales no debería poder entrar si no está logueado...
{
//si le ponés test=true te deja entrar igual y te llena los valores de sesión, esto es más que nada para poder hacer las pruebas de forma local...
$value = $this->request->query('test');
if (isset($value))
{
$_SESSION['web']['nombre'] = 'John';
$_SESSION['web']['apellido'] = 'Doe';
}
if(!isset($_SESSION['web']['nombre']))
$this->redirect('http://www.thesite.com.ar');
}
}
It basically doesn't detect I'm using the prefix "admin" UNTIL I have logged with normal (test) credentials (they are written automatically if you do "site?test")
I hope this is clear...

ASP .NET + IIS + Crystal Reports + Load report failed

I am developping a web application by using the ASP .NET MVC 3 framework.
I have implemented an ASPX page containing a CrystalReportViewer control.
I instantiate a ReportDocument object in my Page_Load event method of my ASPX page.
Then I load a RPT file by using the Load method of my ReportDocument.
My RPT is correctly loaded when I use the VS2010 development web server and I can view it through my viewer.
But the call to the Load method of my ReportDocument raises an exception when I use my IIS 5.1 local web server.
Here are some information about the exception :
Exception Type : CrystalReportsException
Message : Load report failed
StackTrace :
à CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
à CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
à CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
à ASP.aspnetforms_editionresultats_aspx.Page_Load(Object sender, EventArgs e) dans .aspx:ligne 43
à System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
à System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
à System.Web.UI.Control.OnLoad(EventArgs e)
à System.Web.UI.Control.LoadRecursive()
à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Does someone know why the exception is raised when I use IIS ?
This works for me:
protected void Page_UnLoad(object sender, EventArgs e)
{
this.CrystalReportViewer1.Dispose();
this.CrystalReportViewer1 = null;
// CrystalReportViewer1.Close();
// CrystalReportViewer1.Dispose();
GC.Collect();
}
protected void Button1_Click(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("C:\\inetpub\\wwwroot\\CrystalReportDemo\\CrystalReport.rpt");
CrystalReportViewer1.ReportSource = cryRpt;
CrystalReportViewer1.RefreshReport();
}
}
I faced the same problem and what I did to solve the 'Load Report Failed' problem.
First check whether your report folder exists or .rpt files in your project folder after you publish the asp.net project. I simply placed my whole project folder in the IIS root directory. I am using the my reports in 'Reports' folder that doesn't cause any error.
Then copy C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13” into your project main folder like C:\inetpub\wwwroot\YourProjectFolder\.
Please, comment when this doesn't work.

Resources