xBimTeam / XbimWindowsUI

The home of XbimXplorer and WPF components for your desktop BIM applications.
Other
245 stars 149 forks source link

the model is not displayed on the client after deployment #187

Closed RolandoTonin closed 7 months ago

RolandoTonin commented 1 year ago

I inserted the XbimWindowsUI WPF viewer in NET 4.8 into my corporate desktop WPF application. If I start the application from Visual Studio 2022 or from the same workstation where Visual Stuido is installed, I can load and view the model. If, on the other hand, I deploy in the LAN for internal company use through the Publish function of Visual Studio on the clients the model is loaded, I see the tree structure of the entities, I see the grid but the model is not displayed in the graphic viewer and I do not receive errors . The same thing happens if I install the WPF App on the same workstation where Visual Studio is installed. I looked in the "Application Files" sub folder where I made the publish but it seems that the Xbim dlls are all there. What could I have forgotten?

CBenghi commented 1 year ago

Probably the geometry dlls; try opening an xbim file instead, to test this.

On Wed, Jul 20, 2022, 09:04 RolandoTonin @.***> wrote:

I inserted the XbimWindowsUI WPF viewer in NET 4.8 into my corporate desktop WPF application. If I start the application from Visual Studio 2022 or from the same workstation where Visual Stuido is installed, I can load and view the model. If, on the other hand, I deploy in the LAN for internal company use through the Publish function of Visual Studio on the clients the model is loaded, I see the tree structure of the entities, I see the grid but the model is not displayed in the graphic viewer and I do not receive errors . The same thing happens if I install the WPF App on the same workstation where Visual Studio is installed. I looked in the "Application Files" sub folder where I made the publish but it seems that the Xbim dlls are all there. What could I have forgotten?

— Reply to this email directly, view it on GitHub https://github.com/xBimTeam/XbimWindowsUI/issues/187, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJY7MOR4DWX3GL67J7DLUTVU6XJHANCNFSM54CURSAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

andyward commented 1 year ago

I'd guess you need to install the VC runtime on the clients

See https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

RolandoTonin commented 7 months ago

Hy Claudio, is it possible to change predefinedtype of a buildingelementprocy?

My below code not working:

using (var txn = model.BeginTransaction(element.GlobalId.ToString()))
{
    if (!string.IsNullOrEmpty(itm.AssignedPropertyName))
        element.Name = itm.AssignedPropertyName;
    if (!string.IsNullOrEmpty(itm.AssignedObjectTypeName))
    {
        element.PredefinedType = IfcBuildingElementProxyTypeEnum.NOTDEFINED;
        element.ObjectType = itm.AssignedObjectTypeName;
        element.Tag = itm.AssignedTagName;
    }
    txn.Commit();
}

Where elment is IIfcBuildingElementProxy.

Thanks a lot Rolando

andyward commented 7 months ago

Rolando, this would be better off in a separate issue in xbim Essentials if you still have queries.

The code looks fine. Technically it should be

element.PredefinedType = IfcBuildingElementProxyTypeEnum.USERDEFINED; // rather than NOTDEFINED

Not quite sure what the exact problem is? How is it not working? You're not actually saving the model back to a file so it's possible you just need to save it back to IFC. e.g. model.SaveAs("file.ifc") (if using IfcStore)

WZFWork commented 7 months ago

I also encountered this problem. I share the program folder with the network, and if the client runs the program directly, it will inevitably not be able to display graphics. If the client copies the program folder locally and then runs the program, the program can display graphics normally. I migrated the program from 4.8 to 6.0, but the problem still exists.

andyward commented 7 months ago

So running the application from a network share fails? But works if they copy the files locally? We should log that in https://github.com/xBimTeam/XbimGeometry if that's the case.

My guess is it relates to how we probe for the native geometry assemblies in https://github.com/xBimTeam/XbimGeometry/blob/c1c22812601d0bd506c5f9230b731d0ab0c6e08a/Xbim.Geometry.Engine.Interop/XbimCustomAssemblyResolver.cs#L42C37-L42C37

WZFWork commented 7 months ago

Sorry, I need to correct it. I migrated the program from 4.8 to 6.0. Xbim.Common 5.1.435 Xbim.Essentials 5.1.435 Xbim.Geometry 5.1.541 Xbim.WindowsUI 5.1.234 When using the above version components, the client directly runs the program and can display graphics normally.

andyward commented 7 months ago

So problem solved? I suspect it'll be because we using Assembly.Codebase rather than Assembly.Location to locate the executing folder. The former accounts for Shadow-copying (e.g. in legacyASP.NET apps)., but has been deprecated in Net Core (and I my guess is Codebase is forwarding to Location on NET Core, which perhaps supports UNC paths differently)

This whole area has changed in v6 geometry so no plans to address this, unless someone want to supply a PR.

Have logged an issue in Geometry to track