We review some of the results that we have obtained in the last decade on two problems related to the structure and evolution of the solar corona: How to reconstruct the magnetic field of an active region from its values measured at the photospheric level, and how to determine the evolution of the coronal field driven by the stressing of its footpoints on the photosphere and/or by flux emergence through that surface, our main goal being to elucidate the nature of the mechanisms triggering large scale eruptive processes like coronal mass ejections (CMEs). The first part of the paper is devoted to a first approach in which the coronal field is assumed to be force-free at any time (but during the late development of an eruptive event), its evolution being thus considered to be quasi-static. After presenting some general properties of this type of fields, we use this approximate model as a general framework for the reconstruction problem. To get a well posed problem, we introduce the Grad--Rubin formulation in which only a part of the photospheric data are taken into account. We present some mathematical results on this problem (existence and uniqueness of solutions), and report our method to treat it numerically in an efficient way. Thus we turn to the quasi-static boundary driven evolution problem. We find that a continuous injection of energy into a simple field (arcade or tube) by footpoints shearing leads in the ideal case to an expansion of the field which is at least as fast as at large time t, and to its eventual partial or total opening with the formation of a current sheet. The second part of the paper is concerned with a dynamic approach to the evolution problem. The full set of equations of the resistive magnetohydrodynamics is used and solved numerically in two different classes of models. In the first one, the evolution is driven by changing boundary conditions (describing shear, converging motions, flux cancellation, …) imposed at the photospheric level. In the second one, both the corona and the subphotospheric layer (top of the convection zone) are simultaneously considered, and the rising of a twisted tube below the photosphere and its emergence through that surface and subsequent evolution in the corona are followed. In all cases, a catastrophic behavior is found to follow a slow quasi-static phase. It is characterized by a rapid expansion of the field and a release of energy by reconnection. Moreover, a twisted flux rope is always observed to form during the evolution. Depending on the conditions, it is created either in equilibrium during the slow phase, then appearing as a favorable site for the support of a prominence, or during the global disruption phase. The energy of the configuration stays below that of the corresponding open field except when the driving of the evolution is ensured by flux cancellation on the boundary. In that case – to which we refer as the Flux Cancellation Model (FCM) of CME – the open field energy decreases up to a critical point at which it becomes close to the value of the magnetic energy of the configuration, and nonequilibrium sets in. The characteristics of the evolution in FCM are found to be similar in simple and complex topologies (in contrast, the Break Out Model of CME works only for a complex topology). However, when the topology is complex, there is a lowering of the confining effect of the overlying field, and the twisted rope is ejected at a faster rate.