M
M
mjr272014-11-19 18:49:24
JavaScript
mjr27, 2014-11-19 18:49:24

Why did the project stop running after updating to VS2013.4?

I ran into a very strange problem.
There is a windows store universal project on html5 + c# component.
After updating visual studio from 2013.3 to 2013.4, asynchronous goodies in c # suddenly refused to work.
Simplifying and reducing as much as possible:

namespace CsharpNS {
  public sealed class SampleClass {
    public static function DoSomething () {
    }
  }
  internal class Foo {
    internal Foo () {
    }
    internal IAsyncOperation<string> Bar(){
       return Task<string>.Run( /* async */ () => {
         // await Task.Delay(1000);
         return "";
       }).AsAsyncOperation();
    }
  }
}

console.log(CsharpNS.SampleClass.doSomething); // метод существует.
CsharpNS.SampleClass.doSomething(); // если раскомментировать async и delay, то бросается WinRTError: Class not registered. иначе отрабатывает нормально

The funny thing is, everything compiles fine; but it is enough to declare some asynchronous thing somewhere, as everything is covered with a copper basin.
And in 2013.3 everything works fine.
I've already killed a day, trying to understand what I'm doing wrong, what has changed and where to look for a rake.
Oh, great habramind, help me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mjr27, 2015-01-08
@mjr27

Tadam. Solution found. In package.appxmanifest, you need to add the section manually

<Estensions>
    <Extension Category="windows.activatableClass.inProcessServer">
      <InProcessServer>
        <Path>CLRHost.dll</Path>
        <ActivatableClass ActivatableClassId="Class1" ThreadingModel="both" />
        <ActivatableClass ActivatableClassId="Class2" ThreadingModel="both" />
...
        <ActivatableClass ActivatableClassId="ClassN" ThreadingModel="both" />
      </InProcessServer>
    </Extension>
  </Extensions>

which lists all the classes called from winrt. Apparently, there are some glitches with their automatic search and addition to the appxmanifest.
Thanks to everyone (that is, to you, Max), the issue is closed :)

M
Max Maximov, 2014-11-19
@maximka19

After 2013.4, I got an intrusive notification that I need to purchase some kind of license in order to publish the application on the Windows Store. Most likely, maybe the libraries have changed? Try doing Rebuild or Clean.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question