MR-Linac devices under development worldwide will require standard calibration, commissioning, and quality assurance. Solid state radiation detectors are often used for dose profiles and percent depth dose measurements. The dose response of selected solid state detectors is therefore evaluated in varying transverse and longitudinal magnetic fields for this purpose. The Monte Carlo code PENELOPE was used to model irradiation of a PTW 60003 diamond detector and IBA PFD diode detector in the presence of a magnetic field. The field itself was varied in strength, and oriented both transversely and longitudinally with respect to the incident photon beam. The long axis of the detectors was oriented either parallel or perpendicular to the photon beam. The dose to the active volume of each detector in air was scored, and its ratio to dose with zero magnetic field strength was determined as the "dose response" in magnetic field. Measurements at low fields for both detectors in transverse magnetic fields were taken to evaluate the accuracy of the simulations. Additional simulations were performed in a water phantom to obtain few representative points for beam profile and percent depth dose measurements. Simulations show significant dose response as a function of magnetic field in transverse field geometries. This response can be near 20% at 1.5 T, and it is highly dependent on the detectors' relative orientation to the magnetic field, the energy of the photon beam, and detector composition. Measurements at low transverse magnetic fields verify the simulations for both detectors in their relative orientations to radiation beam. Longitudinal magnetic fields, in contrast, show little dose response, rising slowly with magnetic field, and reaching 0.5%-1% at 1.5 T regardless of detector orientation. Water tank and in air simulation results were the same within simulation uncertainty where lateral electronic equilibrium is present and expectedly differed at the beam edge in transverse field orientations only. Due to the difference in design, the two detectors behaved differently. When transverse magnetic fields are present, great care must be taken when using diamond or diode detectors. Dose response varies with relative detector orientation, magnetic field strength, and between detectors. This response can be considerable (∼20% for both detectors). Both detectors in longitudinal fields exhibit little to no dose response as a function of magnetic field. Water tank simulations seem to suggest that the diode detector is better suited to general beam commissioning, and each detector must be investigated separately.