dy-sh / MyNodes.NET

Home automation controller (new version available at https://github.com/dy-sh/singlehub)
GNU General Public License v3.0
73 stars 23 forks source link

Error on startup / Windows 10: CAS policy #13

Closed Swiftnesses closed 8 years ago

Swiftnesses commented 8 years ago

Hello,

I get this when trying to start the latest version on Windows 10 x64.

Error: Unable to load application or execute command 'Microsoft.AspNet.Server.Kestrel'. Available commands: web, localhost, ef. System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence) at System.Reflection.Assembly.LoadFile(String path) at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadFile(String assemblyPath) at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext) at Microsoft.Dnx.Runtime.Loader.PackageAssemblyLoader.Load(AssemblyName assemblyName) at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName) at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName) at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory) at Microsoft.Dnx.Runtime.Loader.LoadContext.LoadAssemblyImpl(AssemblyName assemblyName) at Microsoft.Dnx.Runtime.Loader.LoadContext.ResolveAssembly(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) Press any key to continue . . .

dy-sh commented 8 years ago

http://mynodes.net/Software/Troubleshooting#cas-policy

Swiftnesses commented 8 years ago

Yes, I'm an idiot. Fixed :-)

Swiftnesses commented 8 years ago

The issue is, it pegs my cpu at 50%, known issue?

http://postimg.org/image/tn7wkoidp/

dy-sh commented 8 years ago

I added a few thousand nodes in the scene. CPU load is small.

dy-sh commented 8 years ago

Try to observe in which case the CPU is loaded.

Swiftnesses commented 8 years ago

I have 1 node, fresh install, seems to peg at 50%... Tried a reboot etc.

dy-sh commented 8 years ago

I have no idea what it could be. Try to run fresh copy of the program in a new folder. In the wizard, refuse usage of the database and the gateway. Skip those steps. Look, will this have any effect.

dy-sh commented 8 years ago

Try this cpu usage fix. In nodesEngine.cs

private void UpdateNodesLoop() { Task.Run(() => { while (true) { Thread.Sleep(10); if ((DateTime.Now - lastUpdateTime).TotalMilliseconds < updateInterval) continue;

bkrajendra commented 7 years ago

I was stuck on this CAS issue for almost 15 days. tried everything but no solution. Finally found that setting "Unblock" on individual files may solve this. Hence used a PS command to do it recursively on entire files n folders:

dir -Recurse | Unblock-File

make sure you are inside MyNodes folder.