Migration of WCF service from .NET framework to .NET 7?

74 Views Asked by At

I need to migrate WCF service from .NET framework to .NET 7. I used the Microsoft upgrade assistant tool for this migration. But I am encountering compilation errors.

This is my code:

[WebInvoke(Method = "POST", UriTemplate = "UploadFotoAndroid")]
public string UploadPhotoAndroid(Stream fileContents)
{
    var sFileName = DateTime.Now.ToString("yyyyMMddhhmmssfff") + "foto.png";

    EscreverNoLog("Recebendo arquivo Android - Foto");

    try
    {
        string absFileName = string.Format("{0}\\FileUpload\\{1}"
                                , AppDomain.CurrentDomain.BaseDirectory
                                , sFileName);
        EscreverNoLog("Nome do Arquivo Android - Foto: " + absFileName);

        using (FileStream fs = new FileStream(absFileName, FileMode.Create))
        {
            fileContents.CopyTo(fs);
            fileContents.Close();
        }
        /*
        try
        {
            GerenciaThreadCopia thCopia = new GerenciaThreadCopia();
            thCopia.ChamarThreadCopiaFoto(absFileName);
        }
        catch (Exception)
        {

        }
        */
        return "$$$" + sFileName + "$$$";
    }
    catch (Exception ex)
    {
        EscreverNoLog("Erro recebimento do Arquivo Android - Foto: " + sFileName);
        EscreverNoLog("Mensagem de Erro recebimento do Arquivo Android - Foto: " + ex.Message);
        return "FALHA: " + ex.Message;
    }
} 

The errors:

The Type or namespace name 'WebInvoke' could not be found (are you missing a using directive or an assembly reference?)

The Type or namespace name 'Method' could not be found (are you missing a using directive or an assembly reference?)

Can someone please help me fixing this error?

0

There are 0 best solutions below