dotnet / dotnet/xcsync

UpdateRoslynType compilation error

Open
#101 0 comments 0 reactions 0 assignees View on GitHub
area-watch
Dominant language
C#
Stars
25
Forks
10
Avg merge
12h 50m
Merged PRs (30d)
10

Description

when` xcsync watch` is run on a simple dotnet new iOS project and a change has been detected in the Xcode project, currently encountering the following:

> [13:28:21 ERR xcsync (29)] iOS: Compilation errors found
[13:28:21 ERR xcsync (29)] iOS: /Users/harithamohan/src/iOS/Main.cs(6,41): error CS0246: The type or namespace name 'AppDelegate' could not be found (are you missing a using directive or an assembly reference?)
[13:28:21 ERR xcsync (29)] The AppDelegate type could not be located for synchronization.

So this is stemming from:
https://github.com/dotnet/xcsync/blob/0344c637529976873f615279dd92565a1a72cbc3/src/xcsync/SyncContext.cs#L452

and more specifically, from `UpdateRoslynType`:
https://github.com/dotnet/xcsync/blob/0344c637529976873f615279dd92565a1a72cbc3/src/xcsync/Projects/XcodeWorkspace.cs#L190

Main.cs:
```csharp

using iOS;

// This is the main entry point of the application.
// If you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, typeof (AppDelegate));
```

AppDelegate.cs:
```csharp
namespace iOS;

[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate {
public override UIWindow? Window {
get;
set;
}

public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// create a new window instance based on the screen size
Window = new UIWindow (UIScreen.MainScreen.Bounds);

// create a UIViewController with a single UILabel
var vc = new UIViewController ();
vc.View!.AddSubview (new UILabel (Window!.Frame) {
BackgroundColor = UIColor.SystemBackground,
TextAlignment = UITextAlignment.Center,
Text = "Hello, iOS!",
AutoresizingMask = UIViewAutoresizing.All,
});
Window.RootViewController = vc;

// make the window visible
Window.MakeKeyAndVisible ();

return true;
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.