asp.net – No puedo crear un pdf con report 10.5 Crystal Report en VS2017

Tengo instalado el paquete de CrystalReport para crear pdf versiones 10.5.3700 y 13.0.3500 en Visual Studio 2017. El problema que tengo es a la hora de crear pdf con un report de la version 10.5 desde VS2017. En el administrador de referencias del proyecto con .Net Framework 4.5 en extensiones tenia referenciada la version 13.0 por lo que cambio las referencias a la version 10.5 pero cuando compilo el proyecto. Me salen 2 errores de compilacion:

‘CrystalReportViewer’ is ambiguous in the namespace ‘CrystalDecisions.Web’ en Archivo App_Web_gojru2sa.0.vb linea 238

‘CrystalReportViewer’ is ambiguous in the namespace ‘CrystalDecisions.Web’ en Archivo preview.aspx linea 130

Si intento compilar el proyecto dejando las referencias con la version 13 tengo una excepcion en la linea con codigo:

crs.ReportDocument.Filename = path; 

CrystalDecisions.Shared.CrystalReportsException: El nombre del archivo del informe estaba vacio.

Si desde el editor de VS2017 abro el fichero .rpt y lo vuelvo a grabar me sale un aviso de convertir el rpt a la version actual. Entonces acepto y vuelvo a compilar el programa con las referencias de la version 13 pero me sigue mostrando la misma excepcion en la linea de codigo ‘El nombre del archivo del informe estaba vacio’ en la misma linea. Si vuelvo a poner las referencias de la version 10.5 me salen los 2 errores iniciales de compilacion.

Este es el codigo:

private static void VincularDatosReport(string path, string path2, ref ReportDocument rpt, string Parametro1) {

SqlConnection conn = new SqlConnection();
CrystalReportSource crs = new CrystalReportSource();
crs = new CrystalReportSource();

crs.ReportDocument.FileName = path;
crs.ReportDocument.Refresh();

crs.ReportDocument.SetParameterValue(0, Parametro1);
crs.ReportDocument.SetParameterValue(1, Parametro1);

ConnectionInfo conne = new ConnectionInfo();

conne.ServerName = "NombreServidor";
conne.DatabaseName = "NombreBaseDatos";
conne.UserID = "Usuario";
conne.Password = "Password";

TableLogOnInfo tablelogs = new TableLogOnInfo();

Database db = crs.ReportDocument.Database;
Tables tbls = db.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table tab in tbls)
    {
        tablelogs = tab.LogOnInfo;
        tablelogs.ConnectionInfo = conne;
        tab.ApplyLogOnInfo(tablelogs);
    }

rpt = crs.ReportDocument;
rpt.ExportToDisk(ExportFormatType.PortableDocFormat,"\MiDocumento.pdf");

}

El proyecto lo he generado para .Net Framework 4.5 a partir de “Archivo – Nuevo Proyecto – Sitio web vacío de ASP.NET”

architectural patterns – Poor execution of ASP.net software architecture and how I resolve some of their issues

  1. MVC+ xml web service using MS MVC.

The project is made with MS ASP.net front end and business logic, and the logic contains does coded with some complicated logics to interact with the front end layer , then it calls a xml web service to handle some other business logic, and at the end it interact with the SQL server by stored procedure.

The cons of that implementation is that when things go wrong, it’s hard to step in the web service to trace what is going wrong inside, after the execution run through multiple layers. nd worse of all. there are no logging at all.

I think what goes wrong is that the previous project lead does not instruct the junior programmers to avoid putting logic in the front end asp.net layer, and concentrate engineer the logic behind the web service.

Also the MS-IIS is a beast to configure. people have to dig in the application pool and apply some tricks like, threads, setting some strange user to the OS and apply security on them.

Asp.net Core Applications Issue with Razor and MVC Pages

I have reinstalled my VS 2019 and cloned my applications on my machine. But suddenly all the applications stopped showing add -> Controller –> MVC 5 Controller and its View.
After rebuild my application is converted into Razor from MVC Core 3.1.
and now all applications throws error of g.cshtml.cs file. Help me to fix this issues.

  1. Why my .net core MVC application is converted to Razor.
  2. Why application not adding MVC controller and view.

asp.net – Does X-AspNet-Version correlate to .NET framework version

If a server is reporting its HTTP Headers as:

Server: Microsoft-IIS/10.0
X-SharePointHealthScore: 0
X-AspNet-Version: 4.0.30319

Can this be used to determine if the .NET framework is End of Life. According to Microsoft .NET framework 4.0 is no longer supported.

Support Ending for the .NET Framework 4, 4.5 and 4.5.1

How can I automatically clean up images taken with a mobile device and uploaded to my ASP.net application?

I have a web application written in ASP.net MVC that allows users to take pictures with their mobile device and upload to the application, or they can upload previously saved images. The images are later sent to a customer who goes through some process of printing and scanning that results in the images looking terrible if they are not perfect when they are uploaded.

First off, asking the customer to change their process is off the table. I’d love to do it but for political reasons I can’t.

I’d also like to be able to tell users of my application to use a 3rd party mobile scanning app to take their photos then upload them, but once again for political reasons this isn’t an option either.

Currently my application opens and uses the native device camera to take the photos. Can anyone suggest a plugin or other method that I could integrate into my ASP.net MVC web application that would automatically detect the document and clean it up like a 3rd party mobile scanning app would?

I’ve looked at various packages but I’m hoping for some user testimonials / recommendations. I trust this community more than a software sales rep.

Is it possible to make own select list with values in asp.net core

I’ve got a question. Is it possible to make in asp.net core own select list with values like 8:00, 8:15, 8:30 etc.
I made list in razor view something like that bellow

@{
                    string iString = "";
                    string mString = "";
                }
                @for (int i = 8; i < 18; i++)
                {
                    if (i < 10)
                    {
                        iString = "0" + i;
                    }
                    else
                    {
                        iString = i.ToString();
                    }
                    int m = 0;
                    for (int j = 0; j < 4; j++)
                    {
                        if (m < 10)
                        {
                            mString = "0" + m;
                        }
                        else
                        {
                            mString = m.ToString();
                        }
                        if (i == 10 && j == 2)
                        {
                            <option value="@iString:@mString" disabled class="text-danger">@iString:@mString</option>
                        }
                        else
                        {
                            <option value="@iString:@mString">@iString:@mString</option>
                        }
                        m += 15;
                    }
                }

And I want to make the same but in controller because I need to disable some of this options (I think this is possible to make in SelectList in controller to disable this) Any ideas any advice? Maybe is other way to create somethink like that.

Thank you in advance!

asp.net – como seleccionar item de un listbox en aspx

Intento obtener el texto de un Item al seleccionarlo en un Listbox, pero me sale un mensaje de error que dice: “Referencia a objeto no establecida como instancia de un objeto.”.

en esencia. necesito si alguien sabe como obtener el texto o valor de un Item en un ListBox, este es el código en ASPX.

Protected Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged

    txtTexto.Text = ListBox1.SelectedItem.Text

End Sub

c# – Deletar chave composta com angular e asp.net core

tudo tranquilo? seguinte estou com problemas com chave composta no meu projeto e queria a ajuda de vocês pois ainda não sei muito bem a respeito, estou fazendo o front em Angular e o backend com Asp.net core mvc (usando web API), basicamente o projeto é um CRUD, já consigo listar ele bonitinho porém não consigo deletar, ele sempre me apresenta um erro.

Aqui está o delete no controller:

        (HttpDelete("{id}"))
        public async Task<ActionResult<Access>> DeleteAccess(string Entity, decimal SystemCode)
        {
            var access = await _context.Access.FindAsync(Entity, SystemCode);

            if (access == null)
            {
                return NotFound();
            }

            _context.Access.Remove(access);
            await _context.SaveChangesAsync();

            return access;
        }

Não sei se está correto, se realmente é assim que passa a chave composta (no caso as chaves compostas são Entity e SystemCode).

E no Angular eu fiz o seguinte, no HTML eu coloquei um botão onde o (click) dele eu passo um método chamado delete para um parâmetro chamado row, vejam abaixo:

<button (tooltip)="'Delete Access'" (click)="delete(row)" class="btn btn-danger btn-sm btn-color" type="button" (tooltipAppendToBody)><i class="fa fa-trash"></i></button>

Já no component eu fiz o seguinte no meu método:

  delete(row) {
    this.accessService.delete(row.Entity)
    .then(data => this.getAll());
  }

Sei que meu component está faltando passar o SystemCode no delete mas eu não faço a mínima ideia de como fazer isso.

No navegador quando vejo no console ele passa esse erro:

DELETE http://localhost:52434/access/teste 404 (Not Found)
scheduleTask @ zone.js:3331
ZoneDelegate.scheduleTask @ zone.js:417
onScheduleTask @ zone.js:304
ZoneDelegate.scheduleTask @ zone.js:410
Zone.scheduleTask @ zone.js:241
Zone.scheduleMacroTask @ zone.js:264
scheduleMacroTaskWithCurrentZone @ zone.js:1192
(anônimo) @ zone.js:3364
proto.<computed> @ zone.js:1510
(anônimo) @ http.js:1816
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe @ Observable.js:43
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:29
push../node_modules/rxjs/_esm5/internal/operators/map.js.MapOperator.call @ map.js:18
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchOperator.call @ catchError.js:18
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
subscribeToResult @ subscribeToResult.js:13
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._innerSub @ mergeMap.js:74
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._tryNext @ mergeMap.js:68
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._next @ mergeMap.js:51
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ Subscriber.js:53
(anônimo) @ subscribeToArray.js:5
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe @ Observable.js:43
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:29
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapOperator.call @ mergeMap.js:29
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/rxjs/_esm5/internal/operators/filter.js.FilterOperator.call @ filter.js:15
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
push../node_modules/rxjs/_esm5/internal/operators/map.js.MapOperator.call @ map.js:18
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe @ Observable.js:24
(anônimo) @ Observable.js:98
ZoneAwarePromise @ zone.js:915
push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.toPromise @ Observable.js:96
(anônimo) @ CRUD.service.ts:50
ZoneDelegate.invoke @ zone.js:396
onInvoke @ core.js:27350
ZoneDelegate.invoke @ zone.js:395
Zone.run @ zone.js:153
(anônimo) @ zone.js:894
ZoneDelegate.invokeTask @ zone.js:431
onInvokeTask @ core.js:27338
ZoneDelegate.invokeTask @ zone.js:430
Zone.runTask @ zone.js:198
drainMicroTaskQueue @ zone.js:611
ZoneTask.invokeTask @ zone.js:517
invokeTask @ zone.js:1671
globalZoneAwareCallback @ zone.js:1697
Mostrar 17 mais quadros do código de Biblioteca
core.js:3838 ERROR Error: Uncaught (in promise): HttpErrorResponse: {"headers":{"normalizedNames":{},"lazyUpdate":null},"status":404,"statusText":"Not Found","url":"http://localhost:52434/access/teste","ok":false,"name":"HttpErrorResponse","message":"Http failure response for http://localhost:52434/access/teste: 404 Not Found","error":{"type":"https://tools.ietf.org/html/rfc7231#section-6.5.4","title":"Not Found","status":404,"traceId":"|924b0f7-47c01b3e49c595d5."}}
    at resolvePromise (zone.js:836)
    at resolvePromise (zone.js:795)
    at zone.js:897
    at ZoneDelegate.invokeTask (zone.js:431)
    at Object.onInvokeTask (core.js:27338)
    at ZoneDelegate.invokeTask (zone.js:430)
    at Zone.runTask (zone.js:198)
    at drainMicroTaskQueue (zone.js:611)
    at ZoneTask.invokeTask (as invoke) (zone.js:517)
    at invokeTask (zone.js:1671)

Alguém pode auxiliar este pobre estagiário a solucionar este problema? hahah

asp.net mvc – Publicar sitio en IIS

Estoy tratando de publicar mi sistema hecho en APS.NET MVC5 ien IIS la publicacion todo correcto, pero el problema es que al ingresar a la ruta, solo me muestra el listado de directorios

Es decir que no de ejecuta el Web.config, estoy usando VS2019 y la intefaz de publicacion tambien fué diferente.

¿Porque no se ejecuta?
¿Requiere otra instalacion?

Tengo dependecias de .NET desde 4.0 hasta 4.8 instaladas