Can't find the replacement for EntryPoint Attribute in .net 4.7
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
So i am trying to update the solidoworks macro from .net 3.5 to .net 4.7
And when i was about to do that, i found that there is a method called EntryPoint(0)
which basically is the start point for the macro code.
Adding the code below:
using Microsoft.VisualStudio.Tools.Applications.Contract;
using Microsoft.Office.Tools.Excel;
using Microsoft.Office.Tools;
using SolidWorks;
using SolidWorks.Interop.sldworks;
using System;
using static System.Reflection.MethodInfo;
using System.Runtime.InteropServices;
using System.AddIn.Contract.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Management;
using System.Runtime;
using System.Runtime.InteropServices.ComTypes;
using System.Windows.Forms;
namespace GoPublish.csproj
{
public sealed class SolidWorksMacro : OuterDispProxy
{
[EntryPoint(0)]
public SldWorks swApp;
[DllImport("ole32.dll")]
private static extern int CreateItemMoniker([MarshalAs(UnmanagedType.LPWStr)] string lpszDelim, [MarshalAs(UnmanagedType.LPWStr)] string lpszItem, out IMoniker ppmk);
[DllImport("ole32.dll")]
private static extern int GetRunningObjectTable(uint reserved, out IRunningObjectTable pprot);
I am not able to find a replacement of that in the .net 4.7
Any suggestions as to how can i do that?
c# .net solidworks
add a comment |
So i am trying to update the solidoworks macro from .net 3.5 to .net 4.7
And when i was about to do that, i found that there is a method called EntryPoint(0)
which basically is the start point for the macro code.
Adding the code below:
using Microsoft.VisualStudio.Tools.Applications.Contract;
using Microsoft.Office.Tools.Excel;
using Microsoft.Office.Tools;
using SolidWorks;
using SolidWorks.Interop.sldworks;
using System;
using static System.Reflection.MethodInfo;
using System.Runtime.InteropServices;
using System.AddIn.Contract.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Management;
using System.Runtime;
using System.Runtime.InteropServices.ComTypes;
using System.Windows.Forms;
namespace GoPublish.csproj
{
public sealed class SolidWorksMacro : OuterDispProxy
{
[EntryPoint(0)]
public SldWorks swApp;
[DllImport("ole32.dll")]
private static extern int CreateItemMoniker([MarshalAs(UnmanagedType.LPWStr)] string lpszDelim, [MarshalAs(UnmanagedType.LPWStr)] string lpszItem, out IMoniker ppmk);
[DllImport("ole32.dll")]
private static extern int GetRunningObjectTable(uint reserved, out IRunningObjectTable pprot);
I am not able to find a replacement of that in the .net 4.7
Any suggestions as to how can i do that?
c# .net solidworks
Can you target for Net 3.5? Check installed software and see if Net 3.5 is installed.
– jdweng
Jan 3 at 18:03
@jdweng Yes the system has 3.5 installled. And it works perfect for 3.5. But for windows 10 machines, there is 4.7 installed for default and we want to target for that only. Because when we upgrade the solidworks software, the macro stops working.
– Tejvir Singh
Jan 3 at 18:08
@WaiHaLee I added the code for the macro, the import statements and theEntryPoint(0)
part as well.
– Tejvir Singh
Jan 3 at 18:09
Microsoft does not release each class in Net Library when it does a new release. Only methods that change. So you need to install older version of Net to get all method to run. Also see Solidworks : help.solidworks.com/2018/English/api/sldworksapi/…
– jdweng
Jan 3 at 18:29
add a comment |
So i am trying to update the solidoworks macro from .net 3.5 to .net 4.7
And when i was about to do that, i found that there is a method called EntryPoint(0)
which basically is the start point for the macro code.
Adding the code below:
using Microsoft.VisualStudio.Tools.Applications.Contract;
using Microsoft.Office.Tools.Excel;
using Microsoft.Office.Tools;
using SolidWorks;
using SolidWorks.Interop.sldworks;
using System;
using static System.Reflection.MethodInfo;
using System.Runtime.InteropServices;
using System.AddIn.Contract.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Management;
using System.Runtime;
using System.Runtime.InteropServices.ComTypes;
using System.Windows.Forms;
namespace GoPublish.csproj
{
public sealed class SolidWorksMacro : OuterDispProxy
{
[EntryPoint(0)]
public SldWorks swApp;
[DllImport("ole32.dll")]
private static extern int CreateItemMoniker([MarshalAs(UnmanagedType.LPWStr)] string lpszDelim, [MarshalAs(UnmanagedType.LPWStr)] string lpszItem, out IMoniker ppmk);
[DllImport("ole32.dll")]
private static extern int GetRunningObjectTable(uint reserved, out IRunningObjectTable pprot);
I am not able to find a replacement of that in the .net 4.7
Any suggestions as to how can i do that?
c# .net solidworks
So i am trying to update the solidoworks macro from .net 3.5 to .net 4.7
And when i was about to do that, i found that there is a method called EntryPoint(0)
which basically is the start point for the macro code.
Adding the code below:
using Microsoft.VisualStudio.Tools.Applications.Contract;
using Microsoft.Office.Tools.Excel;
using Microsoft.Office.Tools;
using SolidWorks;
using SolidWorks.Interop.sldworks;
using System;
using static System.Reflection.MethodInfo;
using System.Runtime.InteropServices;
using System.AddIn.Contract.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Management;
using System.Runtime;
using System.Runtime.InteropServices.ComTypes;
using System.Windows.Forms;
namespace GoPublish.csproj
{
public sealed class SolidWorksMacro : OuterDispProxy
{
[EntryPoint(0)]
public SldWorks swApp;
[DllImport("ole32.dll")]
private static extern int CreateItemMoniker([MarshalAs(UnmanagedType.LPWStr)] string lpszDelim, [MarshalAs(UnmanagedType.LPWStr)] string lpszItem, out IMoniker ppmk);
[DllImport("ole32.dll")]
private static extern int GetRunningObjectTable(uint reserved, out IRunningObjectTable pprot);
I am not able to find a replacement of that in the .net 4.7
Any suggestions as to how can i do that?
c# .net solidworks
c# .net solidworks
edited Jan 9 at 23:22
Tejvir Singh
asked Jan 3 at 17:52
Tejvir SinghTejvir Singh
4619
4619
Can you target for Net 3.5? Check installed software and see if Net 3.5 is installed.
– jdweng
Jan 3 at 18:03
@jdweng Yes the system has 3.5 installled. And it works perfect for 3.5. But for windows 10 machines, there is 4.7 installed for default and we want to target for that only. Because when we upgrade the solidworks software, the macro stops working.
– Tejvir Singh
Jan 3 at 18:08
@WaiHaLee I added the code for the macro, the import statements and theEntryPoint(0)
part as well.
– Tejvir Singh
Jan 3 at 18:09
Microsoft does not release each class in Net Library when it does a new release. Only methods that change. So you need to install older version of Net to get all method to run. Also see Solidworks : help.solidworks.com/2018/English/api/sldworksapi/…
– jdweng
Jan 3 at 18:29
add a comment |
Can you target for Net 3.5? Check installed software and see if Net 3.5 is installed.
– jdweng
Jan 3 at 18:03
@jdweng Yes the system has 3.5 installled. And it works perfect for 3.5. But for windows 10 machines, there is 4.7 installed for default and we want to target for that only. Because when we upgrade the solidworks software, the macro stops working.
– Tejvir Singh
Jan 3 at 18:08
@WaiHaLee I added the code for the macro, the import statements and theEntryPoint(0)
part as well.
– Tejvir Singh
Jan 3 at 18:09
Microsoft does not release each class in Net Library when it does a new release. Only methods that change. So you need to install older version of Net to get all method to run. Also see Solidworks : help.solidworks.com/2018/English/api/sldworksapi/…
– jdweng
Jan 3 at 18:29
Can you target for Net 3.5? Check installed software and see if Net 3.5 is installed.
– jdweng
Jan 3 at 18:03
Can you target for Net 3.5? Check installed software and see if Net 3.5 is installed.
– jdweng
Jan 3 at 18:03
@jdweng Yes the system has 3.5 installled. And it works perfect for 3.5. But for windows 10 machines, there is 4.7 installed for default and we want to target for that only. Because when we upgrade the solidworks software, the macro stops working.
– Tejvir Singh
Jan 3 at 18:08
@jdweng Yes the system has 3.5 installled. And it works perfect for 3.5. But for windows 10 machines, there is 4.7 installed for default and we want to target for that only. Because when we upgrade the solidworks software, the macro stops working.
– Tejvir Singh
Jan 3 at 18:08
@WaiHaLee I added the code for the macro, the import statements and the
EntryPoint(0)
part as well.– Tejvir Singh
Jan 3 at 18:09
@WaiHaLee I added the code for the macro, the import statements and the
EntryPoint(0)
part as well.– Tejvir Singh
Jan 3 at 18:09
Microsoft does not release each class in Net Library when it does a new release. Only methods that change. So you need to install older version of Net to get all method to run. Also see Solidworks : help.solidworks.com/2018/English/api/sldworksapi/…
– jdweng
Jan 3 at 18:29
Microsoft does not release each class in Net Library when it does a new release. Only methods that change. So you need to install older version of Net to get all method to run. Also see Solidworks : help.solidworks.com/2018/English/api/sldworksapi/…
– jdweng
Jan 3 at 18:29
add a comment |
1 Answer
1
active
oldest
votes
Class EntryPointAttribute is defined in the Microsoft.VisualStudio.Tools.Applications.Contract.dll, which is a part of VSTA (Visual Studio Tools for Applications). I'm not too familiar with it but my understanding it's a lightweight version of VS for macro/plugin development.
You definitely can build solidworks macros without this dll, but there are a lot of ways to build macros, so maybe with your specific setup you do need it.
I'm guessing you've been using VSTA for your 3.5 version and switched to VisualStudio for 4.7 and that's your actual issue.
.net 4.7 has full support for the libraries build for previous versions, so you can try adding the reference manually. Here's where I was able to find Microsoft.VisualStudio.Tools.Applications.Contract.dll : C:WindowsassemblyGAC_MSILMicrosoft.VisualStudio.Tools.Applications.Contract8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.Tools.Applications.Contract.dll
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54027371%2fcant-find-the-replacement-for-entrypoint-attribute-in-net-4-7%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Class EntryPointAttribute is defined in the Microsoft.VisualStudio.Tools.Applications.Contract.dll, which is a part of VSTA (Visual Studio Tools for Applications). I'm not too familiar with it but my understanding it's a lightweight version of VS for macro/plugin development.
You definitely can build solidworks macros without this dll, but there are a lot of ways to build macros, so maybe with your specific setup you do need it.
I'm guessing you've been using VSTA for your 3.5 version and switched to VisualStudio for 4.7 and that's your actual issue.
.net 4.7 has full support for the libraries build for previous versions, so you can try adding the reference manually. Here's where I was able to find Microsoft.VisualStudio.Tools.Applications.Contract.dll : C:WindowsassemblyGAC_MSILMicrosoft.VisualStudio.Tools.Applications.Contract8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.Tools.Applications.Contract.dll
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
add a comment |
Class EntryPointAttribute is defined in the Microsoft.VisualStudio.Tools.Applications.Contract.dll, which is a part of VSTA (Visual Studio Tools for Applications). I'm not too familiar with it but my understanding it's a lightweight version of VS for macro/plugin development.
You definitely can build solidworks macros without this dll, but there are a lot of ways to build macros, so maybe with your specific setup you do need it.
I'm guessing you've been using VSTA for your 3.5 version and switched to VisualStudio for 4.7 and that's your actual issue.
.net 4.7 has full support for the libraries build for previous versions, so you can try adding the reference manually. Here's where I was able to find Microsoft.VisualStudio.Tools.Applications.Contract.dll : C:WindowsassemblyGAC_MSILMicrosoft.VisualStudio.Tools.Applications.Contract8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.Tools.Applications.Contract.dll
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
add a comment |
Class EntryPointAttribute is defined in the Microsoft.VisualStudio.Tools.Applications.Contract.dll, which is a part of VSTA (Visual Studio Tools for Applications). I'm not too familiar with it but my understanding it's a lightweight version of VS for macro/plugin development.
You definitely can build solidworks macros without this dll, but there are a lot of ways to build macros, so maybe with your specific setup you do need it.
I'm guessing you've been using VSTA for your 3.5 version and switched to VisualStudio for 4.7 and that's your actual issue.
.net 4.7 has full support for the libraries build for previous versions, so you can try adding the reference manually. Here's where I was able to find Microsoft.VisualStudio.Tools.Applications.Contract.dll : C:WindowsassemblyGAC_MSILMicrosoft.VisualStudio.Tools.Applications.Contract8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.Tools.Applications.Contract.dll
Class EntryPointAttribute is defined in the Microsoft.VisualStudio.Tools.Applications.Contract.dll, which is a part of VSTA (Visual Studio Tools for Applications). I'm not too familiar with it but my understanding it's a lightweight version of VS for macro/plugin development.
You definitely can build solidworks macros without this dll, but there are a lot of ways to build macros, so maybe with your specific setup you do need it.
I'm guessing you've been using VSTA for your 3.5 version and switched to VisualStudio for 4.7 and that's your actual issue.
.net 4.7 has full support for the libraries build for previous versions, so you can try adding the reference manually. Here's where I was able to find Microsoft.VisualStudio.Tools.Applications.Contract.dll : C:WindowsassemblyGAC_MSILMicrosoft.VisualStudio.Tools.Applications.Contract8.0.0.0__b03f5f7f11d50a3aMicrosoft.VisualStudio.Tools.Applications.Contract.dll
answered Jan 3 at 21:12
VladVlad
43027
43027
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
add a comment |
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
Thanks a lot. That worked. I was adding the contract files v9.0 and v10.0 in the references but not the one you mentioned. Can you also tell me how to make .swp file from .csproj. Any ideas?
– Tejvir Singh
Jan 3 at 21:32
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
swp is a different type of macro, just use dll that visual studio builds for you
– Vlad
Jan 3 at 22:44
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
read here about different types of SW macro codestack.net/solidworks-api/getting-started/macros/types
– Vlad
Jan 3 at 22:45
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54027371%2fcant-find-the-replacement-for-entrypoint-attribute-in-net-4-7%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you target for Net 3.5? Check installed software and see if Net 3.5 is installed.
– jdweng
Jan 3 at 18:03
@jdweng Yes the system has 3.5 installled. And it works perfect for 3.5. But for windows 10 machines, there is 4.7 installed for default and we want to target for that only. Because when we upgrade the solidworks software, the macro stops working.
– Tejvir Singh
Jan 3 at 18:08
@WaiHaLee I added the code for the macro, the import statements and the
EntryPoint(0)
part as well.– Tejvir Singh
Jan 3 at 18:09
Microsoft does not release each class in Net Library when it does a new release. Only methods that change. So you need to install older version of Net to get all method to run. Also see Solidworks : help.solidworks.com/2018/English/api/sldworksapi/…
– jdweng
Jan 3 at 18:29