我正在运行.NET Standard 2.0 Azure功能,该功能引用了另一个.NET Standard 2.0类库。
我能够构建引用类库的函数。但是当我运行一个使用类库的特定函数时,我得到了一个异常。
public class Test extends JPanel{
private JLabel lblName;
Details details;
public Test(){
lblName = new JLabel();
add(lblName);
init();
initBinding();
}
private void init() {
String sql = "SELECT * FROM details limit 1";
try
{
con = Db.getConnection();
pst = con.prepareStatement(sql);
rs = pst.executeQuery();
details = (Details) rs;
}catch(Exception e){
e.printStackTrace();
}
}
private void initBinding(){
BeanProperty<Details, Srting> beanProperty = BeanProperty.create("name");
BeanProperty<JLabel, String> jTextFieldBeanProperty = BeanProperty.create("text");
AutoBinding<Details, String, JLabel, String> autoBinding_20 = Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, details, beanProperty, lblName, jTextFieldBeanProperty);
autoBinding_20.bind();
// can bind variables
}
}
class Details(){
private Stirng name;
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
this);
public void addPropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(listener);
}
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(listener);
}
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(propertyName,
listener);
}
protected void firePropertyChange(String propertyName, Object oldValue,
Object newValue) {
propertyChangeSupport.firePropertyChange(propertyName, oldValue,
newValue);
}
}
“StorageQueueStandard”是类库的名称。
答案 0 :(得分:0)
[A] System.AppDomain无法转换为[B] System.AppDomain。
从不同的dll加载程序集时会发生这种情况。
如错误所示,System.Private.CoreLib和System.Runtime.Extensions都有System.AppDomain。
请检查您的代码并查看此issue。问题表明新的 .NET Core在运行时尚未支持ServiceBus触发器。
我不清楚你在哪里遇到这个错误,所以如果你还有这个问题,希望你能告诉我更详细的代码和说明。
答案 1 :(得分:0)
为了解决我的问题,我删除了我的项目并使用Visual Studio创建了一个新的azure .net标准函数。
之后我将WindowsAzure.Storage降级为8.6.0。
有关详细信息,请访问:https://github.com/Azure/azure-functions-core-tools/issues/322