|
hasan0305069 wrote: If possible it would be great because I do not need to add any .NET framework in my installer.
True, you don't have to add the .NET Framework to the installer, but the machine your .DLL is installed on MUST have the .NET Framework installed in order to use your .DLL.
|
|
|
|
|
I have a program. I really don't want it to be passed around. Is it possible to make my program run on only one computer? I could probably use the computer name but that can be changed. Is there a different way?
|
|
|
|
|
|
He was out when I called.
|
|
|
|
|
No, there isn't. THat's been the Holy Grail of Copy Protection since the dawn of time and noone has come up with a foolproof solution.
|
|
|
|
|
About the closest you could get would be to use the MAC Address. Not perfect since the network card could be changed but at least it would be more difficult than changing the computer name.
only two letters away from being an asset
|
|
|
|
|
If this is in the wrong forum, feel free to move it. I was not sure where I would get the most help.
I have a Solution that has several 'plugin' files that need to be packaged along with the main Solution for deployment. The steps I take are:
-Publish via Visual Studio 2008 (so it creates the index.htm and setup.exe files)
-Drop the additional files into the publish folder on the web server
-Open the .manifest file with MageUI, add the new files, re-sign with the key provided by VS2008
-Open each of the .application files with MageUI, select the modified .manifest file, re-sign
When I click the install button I get all the way through to just after the install completes, then get a "Application cannot be started." dialog. The log is below.
This is in Windows XP SP2, the Solution is .Net 2.0 and is being compiled in Visual Studio 2008.
What am I doing wrong?
PLATFORM VERSION INFO
Windows : 5.1.2600.196608 (Win32NT)
Common Language Runtime : 2.0.50727.3082
System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000)
mscorwks.dll : 2.0.50727.3082 (QFE.050727-3000)
dfdll.dll : 2.0.50727.3053 (netfxsp.050727-3000)
dfshim.dll : 2.0.50727.3053 (netfxsp.050727-3000)
SOURCES
Deployment url : http:
Server : Microsoft-IIS/7.0
X-Powered-By : ASP.NET
Deployment Provider url : http:
Application url : http:
Server : Microsoft-IIS/7.0
X-Powered-By : ASP.NET
IDENTITIES
Deployment Identity : Deerfield.Client.application, Version=1.0.0.7, Culture=en-US, PublicKeyToken=4bdb671eb25a08c3, processorArchitecture=msil
Application Identity : Deerfield.Client.exe, Version=1.0.0.7, Culture=en-US, PublicKeyToken=4bdb671eb25a08c3, processorArchitecture=msil, type=win32
APPLICATION SUMMARY
* Installable application.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http:
+ A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
COMPONENT STORE TRANSACTION FAILURE SUMMARY
* Transaction at [9/9/2009 9:09:50 AM]
- Staging of a component (WeCare.Billing.dcm.genman) did not succeed.
- Staging of a component file (WeCare.Billing.dcm) did not succeed.
- Staging of a component (Ionic.Utils.Zip.dll.genman) did not succeed.
- Staging of a component file (Ionic.Utils.Zip.dll) did not succeed.
- Staging of a component (Deerfield.Base.dll.genman) did not succeed.
- Staging of a component file (Deerfield.Base.dll) did not succeed.
- Staging of a component (CrystalHelper.dll.genman) did not succeed.
- Staging of a component file (CrystalHelper.dll) did not succeed.
- Staging of a component (WebCrawler.dll.genman) did not succeed.
- Staging of a component file (WebCrawler.dll) did not succeed.
- Staging of a component (Deerfield.Client.exe.genman) did not succeed.
- Staging of a component file (Deerfield.Client.exe) did not succeed.
- Staging of a component (CTE.Plugins.dcm.genman) did not succeed.
- Staging of a component file (CTE.Plugins.dcm) did not succeed.
- Staging of a component (Deerfield.Plugins.Base.dll.genman) did not succeed.
- Staging of a component file (Deerfield.Plugins.Base.dll) did not succeed.
- Installation of deployment (http:
- Setting one or more of the deployment metadata did not succeed.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [9/9/2009 9:09:43 AM] : Activation of http:
* [9/9/2009 9:09:43 AM] : Processing of deployment manifest has successfully completed.
* [9/9/2009 9:09:43 AM] : Installation of the application has started.
* [9/9/2009 9:09:43 AM] : Processing of application manifest has successfully completed.
* [9/9/2009 9:09:46 AM] : Request of trust and detection of platform is complete.
* [9/9/2009 9:09:49 AM] : Downloading of subscription dependencies is complete.
* [9/9/2009 9:09:49 AM] : Commit of the downloaded application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [9/9/2009 9:09:50 AM] System.Runtime.InteropServices.COMException
- A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
- Source: System.Deployment
- Stack trace:
at System.Deployment.Internal.Isolation.IStore.Transact(IntPtr cOperation, StoreTransactionOperation[] rgOperations, UInt32[] rgDispositions, Int32[] rgResults)
at System.Deployment.Internal.Isolation.Store.Transact(StoreTransactionOperation[] operations, UInt32[] rgDispositions, Int32[] rgResults)
at System.Deployment.Application.ComponentStore.SubmitStoreTransaction(StoreTransactionContext storeTxn, SubscriptionState subState)
at System.Deployment.Application.ComponentStore.SubmitStoreTransactionCheckQuota(StoreTransactionContext storeTxn, SubscriptionState subState)
at System.Deployment.Application.ComponentStore.CommitApplication(SubscriptionState subState, CommitApplicationParams commitParams)
at System.Deployment.Application.SubscriptionStore.CommitApplication(SubscriptionState& subState, CommitApplicationParams commitParams)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
* Transaction at [9/9/2009 9:09:50 AM]
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Installed
- HRESULT: 0x0
- Manifest: B0T18YCN.VEK.application
+ System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
- Status: Set
- HRESULT: 0x0
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Installed
- HRESULT: 0x0
- Manifest: Deerfield.Client.exe.manifest
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Modules\CTE.Plugins.exe.config
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Modules\CTE.Plugins.pdb
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Modules\WeCare.Billing.pdb
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Resources\Arrow_Right.png
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Resources\Arrow_Left.png
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Deerfield.Base.pdb
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Modules\Deerfield.Plugins.Base.pdb
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Deerfield.Client.pdb
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Resources\Icon_Normal.ico
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Modules\WeCare.Billing.exe.config
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Installed
- HRESULT: 0x0
- File: Deerfield.Client.exe.config
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x8007001f
- Manifest: WeCare.Billing.dcm.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: WeCare.Billing.dcm
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: Ionic.Utils.Zip.dll.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: Ionic.Utils.Zip.dll
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: Deerfield.Base.dll.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: Deerfield.Base.dll
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: CrystalHelper.dll.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: CrystalHelper.dll
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: WebCrawler.dll.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: WebCrawler.dll
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: Deerfield.Client.exe.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: Deerfield.Client.exe
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: CTE.Plugins.dcm.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: CTE.Plugins.dcm
+ System.Deployment.Internal.Isolation.StoreOperationStageComponent
- Status: Failed
- HRESULT: 0x1
- Manifest: Deerfield.Plugins.Base.dll.genman
+ System.Deployment.Internal.Isolation.StoreOperationStageComponentFile
- Status: Failed
- HRESULT: 0x1
- File: Deerfield.Plugins.Base.dll
+ System.Deployment.Internal.Isolation.StoreOperationInstallDeployment
- Status: Failed
- HRESULT: 0x1
- AppId: http:
+ System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata
- Status: Failed
- HRESULT: 0x1
+ System.Deployment.Internal.Isolation.StoreTransactionOperationType (27)
- HRESULT: 0x1
|
|
|
|
|
hi am new to linq i want to be able to insert manny rows transactiondetail with this code
ctx.MasterTransaction.InsertOnSubmit(tranmaster)
ctx.Submitchange()
For Each td As TransactionDetail In transdetail
td.TransId = tranmaster.TransId
Next
ctx.TransactionDetails.InsertAllOnSubmit (transdetail)
ctx.SubmitChanges()
i get this error 'Cannot add an entity with a key that is already in use' on submit changes
|
|
|
|
|
hi am new to ling i want to be able to insert manny rows transactiondetail with this code
ctx.MasterTransaction.InsertOnSubmit(tranmaster)
ctx.Submitchange()
For Each td As TransactionDetail In transdetail
td.TransId = tranmaster.TransId
Next
ctx.TransactionDetails.InsertAllOnSubmit (transdetail)
ctx.SubmitChanges()
i get this error 'Cannot add an entity with a key that is already in use' on submit changes
|
|
|
|
|
Hi,
I just wanted some clarification for using statement. With reference to my below code, lets say for some reason there is any exception on the following line of code - command.Parameters.Add("@ID", SqlDbType.Int)
So in case of exception, the lines of code after the above line of code will not get executed and the control will move on to the last line of the method. Considering this scenario, I wanted to know will the connection and command objects (which are already initialised) get disposed?
using (DbConnection connection =
this.Database.ConnectionManager.GetConnection())
{
using (DbCommand command = connection.CreateCommand())
{
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "spGetList";
command.Parameters.Add("@ID", SqlDbType.Int)
command.Parameters("@ID").Value = this.ID
using(DbDataReader dataReader =
this.Database.Execute<DbDataReader>(command,
DatabaseExecutionType.DataReader))
{
this.Fill(dataReader);
}
}
}
Regards,
Vipul Mehta
|
|
|
|
|
The Using statement usually cleans up[^], that is, if your object is disposable.
Alas, the documentation [^]for SqlConnection states;
MSDN wrote: If the SqlConnection goes out of scope, it won't be closed. Therefore, you must explicitly close the connection by calling Close or Dispose. Close and Dispose are functionally equivalent. If the connection pooling value Pooling is set to true or yes, the underlying connection is returned back to the connection pool. On the other hand, if Pooling is set to false or no, the underlying connection to the server is actually closed.
I are Troll
|
|
|
|
|
using will ensure you to dispose an IDisposable-derived object even if you return from inside the "using" block.
Best regards,
Jaime.
|
|
|
|
|
connection , command and dataReader will all have their Dispose or IDisposable.Dispose methods called.
|
|
|
|
|
In general, 'Using' is an almost magic bullet to ensure that allocated resources will get freed when used as indicated above. It's not always perfect, however. The biggest gotcha I have found is that a constructor itself creates iDisposable objects which are supposed to get disposed at a later time and an exception is thrown in the constructor, the constructor itself must dispose of those objects, since the partially-constructed object will be going out of scope.
For example, using VB syntax:
Sub New(whatever_arguments...)
Try
.. construct the object
Catch
Me.Dispose()
Throw
End Try
End Sub
Note that the catch block doesn't swallow an exception nor even throw a new one; it simply re-throws the old exception so as to preserve the stack trace.
|
|
|
|
|
We can use .net class (Manage code) in using clause it will automatically goes out of scope. You don't need to close or dispose out side, Because they called dispose function.all the class which is implemented the idisposable intercace will work on using clause
|
|
|
|
|
using keyword is nothing but a syntactic sugar over try-finally construct. For example, the following code
using (SqlConnection conn = new SqlConnection(...)) {
....
....
....
}
actually gets compiled to
SqlConnection conn = new SqlConnection(...);
try {
....
....
....
}
finally {
if (conn is IDisposable) {
conn.Dispose();
}
}
Therefore, irrespective of whether an exception is thrown or a return statement is encountered, the finally blok is always executed and ensures that objects that implement IDisposable are always cleaned up (unless the runtime host chooses not to do so - just to complicate things).
|
|
|
|
|
Exception message:
"Unrecognized attribute 'valid'. Note that attribute names are case-sensitive.
I used to have a field called "valid" in one of my configuration elements, but through the course of development it's now obsolete, so I'd like to remove it. I removed it from the ConfigurationElement subclass, and now when I try to read the config section (via config.GetSection), I get the above exception, which then makes my config section variable null, blah blah blah, no saved config = program effectively unusable from session to session.
Google fails me. MSDN fails me. Internet fails me.
I'm new to the ConfigurationManager, having only ever done equivalent functionality through .ini files before, so I'm sure there's probably just some "cleanup" command I can do that I'm just not aware of.
modified on Friday, October 23, 2009 2:41 PM
|
|
|
|
|
I believe you are writing a class to read configuration values from a config class. You have removed the 'valid' element from the spec but not from the config file. I think, removing the 'valid' element from the config file should solve your problem.
|
|
|
|
|
Yes, that's more or less the problem, but since it's using the ConfigurationManager, the actual config file operations are completely hidden (as far as I know), or at least I don't know where to find it.
|
|
|
|
|
What kind of app r u developing? Windows or Web ? Whatever it is you should have full control over your config files.
|
|
|
|
|
It's a Windows app using the built-in ConfigurationManager .NET capabilities. I based it on this MSDN code sample[^]. Maybe it'll be easier to just show some code:
Configuration classes:
public class SerialConfig : ConfigurationElement
{
[ConfigurationProperty("valid",
DefaultValue = false,
IsRequired = false)]
public bool Valid
{
get
{
return (bool)this["valid"];
}
set
{
this["valid"] = (bool)value;
}
}
[ConfigurationProperty("baud",
DefaultValue = 115200,
IsRequired = true)]
public int Baud
{
get
{
return (int)this["baud"];
}
set
{
if((value == 115200) || (value == 9600))
{
this["baud"] = value;
}
else
{
}
}
}
[ConfigurationProperty("name",
DefaultValue = "",
IsRequired = true)]
public String Name
{
get
{
return (string)this["name"];
}
set
{
if (value.Contains("COM"))
{
this["name"] = value;
}
else
{
this["name"] = "INVALID";
}
}
}
public SerialConfig(String name, int baud)
{
this["baud"] = baud;
this["name"] = name;
}
public SerialConfig(string name)
{
new SerialConfig(name, 115200);
}
public SerialConfig()
{
new SerialConfig("INVALID", 115200);
}
}
public class SerialConfigSection : ConfigurationSection
{
public SerialConfigSection()
{
this["serialConfig"] = new SerialConfig();
}
[ConfigurationProperty("serialConfig")]
public SerialConfig serialConfig
{
get
{
return (
(SerialConfig)this["serialConfig"]);
}
set
{
this["serialConfig"] = value;
}
}
}
Actual usage of configuration
public static void InitializeConfig()
{
Configuration userConfig =
ConfigurationManager.OpenExeConfiguration(
ConfigurationUserLevel.PerUserRoamingAndLocal);
ExeConfigurationFileMap configFileMap =
new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename =
userConfig.FilePath;
config =
ConfigurationManager.OpenMappedExeConfiguration(
configFileMap, ConfigurationUserLevel.None);
EITPortConfig = null;
BridgePortConfig = null;
try
{
EITPortConfig = (SerialConfigSection)config.GetSection("EITCOMPort");
BridgePortConfig = (SerialConfigSection)config.GetSection("BridgeCOMPort");
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("EITCOMPort");
ConfigurationManager.RefreshSection("BridgeCOMPort");
if (EITPortConfig == null)
{
EITPortConfig = new SerialConfigSection();
EITPortConfig.SectionInformation.AllowExeDefinition =
ConfigurationAllowExeDefinition.MachineToLocalUser;
EITPortConfig.SectionInformation.AllowOverride = true;
config.Sections.Add("EITCOMPort", EITPortConfig);
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("EITCOMPort");
}
if (BridgePortConfig == null)
{
BridgePortConfig = new SerialConfigSection();
BridgePortConfig.SectionInformation.AllowExeDefinition =
ConfigurationAllowExeDefinition.MachineToLocalUser;
BridgePortConfig.SectionInformation.AllowOverride = true;
config.Sections.Add("BridgeCOMPort", BridgePortConfig);
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("BridgeCOMPort");
}
}
catch (ConfigurationErrorsException e)
{
Console.WriteLine("[Exception error: {0}]", e.ToString());
}
}
|
|
|
|
|
Your solution must have a default configuration file (app.config) that is used as a template to create local copies during deployment. For example, if you app name is myapp.exe, then your configuration file name during deployment is myapp.exe.config. Changing the app.config should solve your problem.
|
|
|
|
|
In the InitializeConfig() method, debug and check the value of userConfig.FilePath property. I think that should tell you the configuration file path.
|
|
|
|
|
Thank you! That finally resolved the issue. I knew it had to be lingering around somewhere.
|
|
|
|
|
Hi all,
I think this can trigger a nice discussion about .net capabilities.
I want to have a big single assembly with dozens of functionality groups, but I don't want them to be uploaded into memory until they are really needed.
This is a proof of concept, trying to demonstrate the best way to deploy a multi-mission application that has all possible functionalities in a single assembly, and, according to configuration, will run use specific classes.
The purpose is to ensure to distribute all functionalities in a single file and avoid branching problems without memory costs.
Thanks in advance.
Best regards,
Jaime.
|
|
|
|
|