@(i=gamui/supershopuii/activicy-68.jpg)

Ann不够喜欢的音乐 - 歌单 - 网易云音乐
Ann不够喜欢的音乐
播放:2653次
网易云音乐多端下载
同步歌单,随时畅听320k好音乐
网易公司版权所有(C)杭州乐读科技有限公司运营:
举报邮箱:违法和不良信息举报电话:3-20394c# - Inconsistent Accessibility: Parameter type is less accessible than method - Stack Overflow
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
I'm trying to pass an object (a reference to the currently logged on user, basically) between two forms.
At the moment, I have something along these lines in the login form:
private ACTInterface oActI
public void button1_Click(object sender, EventArgs e)
oActInterface = new ACTInterface(@"\\actserver\Database\Premier.pad",this.textUser.Text,this.textPass.Text);
if (oActInterface.checkLoggedIn())
//user has authed against ACT, so we can carry on
clients oClientForm = new clients(oActInterface);
this.Hide();
oClientForm.Show();
on the next form (clients), I have:
public partial class clients : Form
private ACTInterface oActInt {}
public clients(ACTInterface _oActInt)
...which results in me getting:
Inconsistent accessibility:
parameter type 'support.ACTInterface' is less accessible than method
'support.clients.clients(support.ACTInterface)'
c:\work\net\backup\support\support\clients.cs
I don't really understand what the problem is - both fields are private, and accessed by the relevant public method from the form.
Googling doesn't really help, as it just points towards one element being public and the other private, which isn't the case here.
Anybody help?
183k25343474
Constructor of public class clients is public but it has a parameter of type ACTInterface that is private (it is nested in a class?). You can't do that. You need to make ACTInterface at least as accessible as clients.
183k25343474
Make the class public.
class NewClass
is the same as:
internal class NewClass
so the class has to be public
If sounds like the type ACTInterface is not public, but is using the default accessibility of either internal (if it is top-level) or private (if it is nested in another type).
Giving the type the public modifier would fix it.
Another approach is to make both the type and the method internal, if that is your intent.
The issue is not the accessibility of the field (oActInterface), but rather of the type ACTInterface itself.
726k18120232457
What is the accessibility of the type support.ACTInterface.
The error suggests it is not public.
You cannot expose a public method signature where some of the parameter types of the signature are not public.
It wouldn't be possible to call the method from outside since the caller couldn't construct the parameters required.
If you make support.ACTInterface public that will remove this error.
Alternatively reduce the accessibility of the form method if possible.
12.9k22850
The problem doesn't seem to be with the variable but rather with the declaration of ACTInterface. Is ACTInterface declared as internal by any chance?
10.7k33369
If this error occurs when you want to use a classvariable in a new form, you should put the class definition in the
Formname.Designer.cs
instead of the Formname.cs file.
After updating my entity framework model, I found this error infecting several files in my solution. I simply right clicked on my .edmx file and my TT file and click "Run Custom Tool" and that had me right again after a restart of Visual Studio 2012.
8382058123
what ever u provide class ActInterface is under private class thats way it is getting error
change that class type to Public ActInterface it will resolve
Try making your constructor private like this:
private Foo newClass = new Foo();
3,68711628
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledBilii-Zizi EDM - 歌单 - 网易云音乐
Bilii-Zizi EDM
播放:1048次
网易云音乐多端下载
同步歌单,随时畅听320k好音乐
网易公司版权所有(C)杭州乐读科技有限公司运营:
举报邮箱:违法和不良信息举报电话:3-20394appium 1.2.0
android 4.1.1
启动代码如下:
public void setUp() throws Exception
// 配置webdriver
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("automationName", "Selendroid");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("deviceName", "192.168.56.101:5555");
capabilities.setCapability("platformVersion", "4.1.1");
capabilities.setCapability("app", "D:\\workspace\\wapjs_client\\apps\\jsmcc.apk");
capabilities.setCapability("appPackage", "com.jsmcc");
capabilities.setCapability("appActivity", ".ui.WelcomeActivity");
// appium的独特地方,使用自己的AppiumDriver, 它本身是继承自WebDriver
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
appium报错日志为:
debug: Selendroid server is alive!
debug: Listening for Selendroid logs
debug: Creating Selendroid session
debug: Making http request with opts: {"url":"http://localhost:8080/wd/hub/sessi
on","method":"POST","json":{"desiredCapabilities":{"warnings":{},"desired":{"aut
omationName":"Selendroid","platformVersion":"4.1.1","app":"D:\\workspace\\wapjs_
client\\apps\\jsmcc.apk","platformName":"Android","deviceName":"192.168.56.101:5
555","browserName":"","appActivity":".ui.WelcomeActivity","appPackage":"com.jsmc
c"},"automationName":"Selendroid","platformVersion":"4.1.1","app":"D:\\workspace
\\wapjs_client\\apps\\jsmcc.apk","platformName":"Android","deviceName":"192.168.
56.101:5555","browserName":"","appActivity":".ui.WelcomeActivity","appPackage":"
com.jsmcc"}}}
debug: Successfully started selendroid session
debug: Waiting for pkg "com.jsmcc" and activity ".ui.WelcomeActivity" to be focu
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: [SELENDROID] http://localhost:8080/wd/hub/session/5ad873c4-d754-cd01-a387
-42a1aa5de440
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
error: com.jsmcc/.ui.WelcomeActivity never started. Current: com.jsmcc/.ui.Featu
reActivity
debug: Selendroid hasn't started app yet, let's do it manually with adb.startApp
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "am start -S -a android.intent.action.MAIN -c android.intent.category
.LAUNCHER -f 0x -n com.jsmcc/.ui.WelcomeActivity"
debug: Waiting for pkg "com.jsmcc" and activity ".ui.WelcomeActivity" to be focu
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: Getting focused package and activity
debug: executing: "F:\android_sdk\sdk\platform-tools\adb.exe" -s 192.168.56.101:
5555 shell "dumpsys window windows"
debug: Getting focused package and activity
error: com.jsmcc/.ui.WelcomeActivity never started. Current: com.android.launche
r/com.android.launcher2.Launcher
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: com.jsmcc/.ui.WelcomeA
ctivity never started. Current: com.android.launcher/com.android.launcher2.Launc
debug: Error: com.jsmcc/.ui.WelcomeActivity never started. Current: com.android.
launcher/com.android.launcher2.Launcher
at null.&anonymous& (C:\Users\Administrator\AppData\Roaming\npm\node_modules
\appium\node_modules\appium-adb\lib\adb.js:1273:12)
at null.&anonymous& (C:\Users\Administrator\AppData\Roaming\npm\node_modules
\appium\node_modules\appium-adb\lib\adb.js:1218:7)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modul
es\appium-adb\lib\adb.js:162:5
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.&anonymous& (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
debug: Responding to client with error: {"status":33,"value":{"message":"A new s
ession could not be created. (Original error: com.jsmcc/.ui.WelcomeActivity neve
r started. Current: com.android.launcher/com.android.launcher2.Launcher)","origV
alue":"com.jsmcc/.ui.WelcomeActivity never started. Current: com.android.launche
r/com.android.launcher2.Launcher"},"sessionId":null}
有没有谁碰到这样的问题啊?求大神帮助
am start -S -a android.intent.action.MAIN -c android.intent.category
.LAUNCHER -f 0x -n com.jsmcc/.ui.WelcomeActivity
执行下这句看看,是不是能启动,还是启动后挂掉了?
执行后显示,模拟器上是启动成功的
C:\Users\Administrator&adb shell
root@android:/ # am start -S -a android.intent.action.MAIN -c android.intent.cat
egory.LAUNCHER -f 0x -n com.jsmcc/.ui.WelcomeActivity
AUNCHER -f 0x -n com.jsmcc/.ui.WelcomeActivity
Stopping: com.jsmcc
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.L
AUNCHER] flg=0x cmp=com.jsmcc/.ui.WelcomeActivity }
菜鸟表示不懂appium,看你错误信息,没有启动WelcomeActivity,是不是WelcomeActivity只在安装的时候启动App才会到这个Activity呢?再次启动就不经过该Activity呢?
只是一点点分析,如有误,请忽略。
appium 1.2版,不用指定appPackage和appActivity了,只用正确指定app安装路径就ok了。appium会自动识别。我现在跑脚本都没指定了。。
WelcomeActivity是一个欢迎页,要是换成别的话,页面不会成功加载,显示一半
我试了下不指定appPackage和appActivity,还是一样的错误,appium版本是1.2.0
LZ的问题解决了吗?
还没有解决。。。
我也遇见了,
我发的帖子,
楼主这个问题解决了吗?
解决方法:
设置多一个 capability, 如下
capabilities.setCapability("appWaitActivity", ".当前activity");
后方可回复, 如果你还没有账号请点击这里 。
panzhigang (panzhigang)
第 331 位会员 /
共收到 10 条回复2016年度精选Remix电音 - 歌单 - 网易云音乐
2016年度精选Remix电音
收集了2016年电音 ,全是个人精选。
播放:20078次
喜欢这个歌单的人
网易云音乐多端下载
同步歌单,随时畅听320k好音乐
网易公司版权所有(C)杭州乐读科技有限公司运营:
举报邮箱:违法和不良信息举报电话:3-20394

我要回帖

更多关于 activinspire 的文章

 

随机推荐